Advertisement
Cremulus

ADDWF(1998)

May 30th, 2017
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. ; Drive the ADDWF, etc
  2.  
  3. ; ADDWF 42
  4. ; ADDWF 42,F
  5. ; ADDWF 42,W <- Mask opcode with FF7F
  6.  
  7. rADDWF: mov cx,cs:2[bx] ; Get the op-code
  8.  
  9. ; Now, get the register address. 7-bit
  10.  
  11. call Get_Expr_7 ; Giz the immediate
  12. jc ADDWF_Error ; Fail
  13.  
  14. ; Build the op-code
  15.  
  16. or cx,ax ; Merge op-code
  17.  
  18. ; Now, we can have a ",F" or a ",W" here
  19.  
  20. call Skip_Spc ; Skip the spaces
  21.  
  22. cmp al,"," ; "," ?
  23. jne rADDWF_Plant ; No, assume we're done
  24.  
  25. call Skip_1_Spc ; Skip ","
  26.  
  27. ; Now, we must have a "F" or "W"
  28.  
  29. cmp al,icTok_LC ; Token ?
  30. jne ADDWF_Syntax ; No, fail
  31.  
  32. mov al,es:1[di] ; Get it
  33.  
  34. inc di ; Presume we can skip it
  35. inc di ;
  36.  
  37. ; Now, this must be a "F" (t52) or a "W" (t53)
  38.  
  39. cmp al,052h ; "F"?
  40. je rADDWF_Plant ; Yes, this is the default, plant it
  41.  
  42. and cl,07Fh ; Presume it's a xxxx,W
  43.  
  44. cmp al,053h ; "W"?
  45. je rADDWF_Plant ; Yes, the opcode is correct, plant it
  46.  
  47. ; Bugger, don't know.
  48.  
  49. dec di ; Restore
  50. dec di ;
  51.  
  52. ; Fall into. . .
  53.  
  54. ADDWF_Syntax: jmp rSyntax ; Vector
  55.  
  56. ; Plant CX
  57.  
  58. rADDWF_Plant: mov ax,cx ; Get the opcode
  59. jmp Plant_Word ; Dump it
  60.  
  61. ADDWF_Error: jmp rError ; Vector
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement