??? 03/16/04 03:06 Read: times |
#66803 - expain code |
;dcomp actually takes care of printing a word from the dictionary
; dptr = position in packed words table ; r4=0 if next nibble is low, r4=255 if next nibble is high decomp: anl a, #0x7F mov r0, a ;r0 counts which word jb psw.1, decomp1 ;avoid leading space if first word lcall space decomp1:clr psw.1 push dpl push dph mov dptr, #words mov r4, #0 mov a, r0 jz dcomp3 ;here we must seek past all the words in the table ;that come before the one we're supposed to print mov r1, a dcomp2: acall get_next_nibble jnz dcomp2 ;when we get here, a word has been skipped... keep doing ;this until we're pointing to the correct one djnz r1, dcomp2 dcomp3: ;now we're pointing to the correct word, so all we have ;to do is print it out acall get_next_nibble jz dcomp_end cjne a, #15, dcomp4 ;the character is one of the 12 least commonly used acall get_next_nibble inc a movc a, @a+pc sjmp dcomp5 .db "hfwgybxvkqjz" dcomp4: ;the character is one of the 14 most commonly used inc a movc a, @a+pc sjmp dcomp5 .db "etarnisolumpdc" dcomp5: ;decide if it should be uppercase or lowercase mov c, psw.5 mov acc.5, c setb psw.5 cjne r0, #20, dcomp6 clr acc.5 dcomp6: cjne r0, #12, dcomp7 clr acc.5 dcomp7: lcall cout sjmp dcomp3 dcomp_end: pop dph pop dpl ajmp pcstr1 get_next_nibble: ;...and update dptr and r4, of course clr a movc a, @a+dptr cjne r4, #0, gnn2 mov r4, #255 anl a, #00001111b ret gnn2: mov r4, #0 inc dptr swap a anl a, #00001111b ret i am trying to understand what the line cjne a,#15,dcomp4 is doing. I think that it looks for the most used characters then it looks for the not used can someone explain this to me tnx ron hathcock |
Topic | Author | Date |
expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
Its Paulmon | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: expain code | 01/01/70 00:00 | |
RE: explain code | 01/01/70 00:00 | |
RE: explain code | 01/01/70 00:00 | |
RE: explain code | 01/01/70 00:00 | |
RE: expain code![]() | 01/01/70 00:00 |