fork download
  1. START START
  2. LD GR1,=#8000 ; 左側パターン(右シフト用)
  3. LD GR2,=1 ; 右側パターン(左シフト用)
  4. LD GR4,=16 ; ループカウンタ
  5.  
  6. LOOP LD GR3,GR1 ; 右側パターンをロード
  7. XOR GR3,GR2 ; 左側パターンをXOR
  8. CALL PRWORD ; 1ワード2進表示
  9.  
  10. SRA GR1,1 ; 左側パターンを符号付き右シフト
  11. SLL GR2,1 ; 右側パターンを符号なし左シフト
  12. SUBA GR4,=1 ; ループカウンタ減算
  13. JNZ LOOP
  14. RET
  15.  
  16. ; 1ワードを2進表示ルーチン (GR3 が表示したい1ワード)
  17. PRWORD PUSH 0,GR1
  18. PUSH 0,GR2
  19. PUSH 0,GR4
  20. PUSH 0,GR5
  21.  
  22. LD GR1,='0' ; '0'文字
  23. LD GR2,='1' ; '1'文字
  24. LD GR4,=16 ; カウンタ
  25. LD GR5,=0 ; バッファのインデックス
  26.  
  27. PRLOOP SLL GR3,1 ; GR3 を 符号なし左シフト
  28. JOV SET1 ; 最上位ビットが1だったらSET1へ
  29. ST GR1,BUFFER,GR5 ; '0'文字セット
  30. JUMP NEXT
  31.  
  32. SET1 ST GR2,BUFFER,GR5 ; '1'文字セット
  33.  
  34. NEXT ADDA GR5,=1 ; バッファインデックスをインクリメント
  35. SUBA GR4,=1 ; カウンタデクリメント
  36. JNZ PRLOOP
  37.  
  38. OUT BUFFER,LENBUF ; 1行表示
  39.  
  40. POP GR5
  41. POP GR4
  42. POP GR2
  43. POP GR1
  44. RET
  45.  
  46. LENBUF DC 16 ; バッファ長
  47. BUFFER DS 16 ; バッファ領域
  48.  
  49. END
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.s: Assembler messages:
prog.s: Warning: end of file not at end of a line; newline inserted
prog.s:1: Error: no such instruction: `start START'
prog.s:2: Error: no such instruction: `ld GR1,='
prog.s:3: Error: no such instruction: `ld GR2,=1'
prog.s:3: Error: invalid character (0xe5) in mnemonic
prog.s:4: Error: no such instruction: `ld GR4,=16'
prog.s:4: Error: invalid character (0xe3) in mnemonic
prog.s:6: Error: junk `GR3' after expression
prog.s:6: Error: too many memory references for `loop'
prog.s:6: Error: invalid character (0xe5) in mnemonic
prog.s:7: Error: too many memory references for `xor'
prog.s:7: Error: invalid character (0xe5) in mnemonic
prog.s:8: Error: invalid character (0xef) in mnemonic
prog.s:10: Error: no such instruction: `sra GR1,1'
prog.s:10: Error: invalid character (0xe5) in mnemonic
prog.s:11: Error: no such instruction: `sll GR2,1'
prog.s:11: Error: invalid character (0xe5) in mnemonic
prog.s:12: Error: no such instruction: `suba GR4,=1'
prog.s:12: Error: invalid character (0xe3) in mnemonic
prog.s:16: Error: invalid character (0xef) in mnemonic
prog.s:17: Error: no such instruction: `prword PUSH 0,GR1'
prog.s:18: Error: too many memory references for `push'
prog.s:19: Error: too many memory references for `push'
prog.s:20: Error: too many memory references for `push'
prog.s:22: Error: no such instruction: `ld GR1,=48'
prog.s:22: Error: junk at end of line, first unrecognized character is `4'
prog.s:23: Error: no such instruction: `ld GR2,=49'
prog.s:23: Error: junk at end of line, first unrecognized character is `4'
prog.s:24: Error: no such instruction: `ld GR4,=16'
prog.s:24: Error: invalid character (0xe3) in mnemonic
prog.s:25: Error: no such instruction: `ld GR5,=0'
prog.s:25: Error: invalid character (0xe3) in mnemonic
prog.s:27: Error: no such instruction: `prloop SLL GR3,1'
prog.s:27: Error: no such instruction: `gr3 を 符号なし左シフト'
prog.s:28: Error: no such instruction: `jov SET1'
prog.s:28: Error: invalid character (0xe6) in mnemonic
prog.s:29: Error: no such instruction: `st GR1,BUFFER,GR5'
prog.s:29: Error: junk at end of line, first unrecognized character is `4'
prog.s:30: Error: no such instruction: `jump NEXT'
prog.s:32: Error: no such instruction: `set1 ST GR2,BUFFER,GR5'
prog.s:32: Error: junk at end of line, first unrecognized character is `4'
prog.s:34: Error: no such instruction: `next ADDA GR5,=1'
prog.s:34: Error: invalid character (0xe3) in mnemonic
prog.s:35: Error: no such instruction: `suba GR4,=1'
prog.s:35: Error: invalid character (0xe3) in mnemonic
prog.s:38: Error: too many memory references for `out'
prog.s:38: Error: invalid character (0xef) in mnemonic
prog.s:46: Error: no such instruction: `lenbuf DC 16'
prog.s:46: Error: invalid character (0xe3) in mnemonic
prog.s:47: Error: no such instruction: `buffer DS 16'
prog.s:47: Error: invalid character (0xe3) in mnemonic
prog.s:49: Error: no such instruction: `end'
stdout
Standard output is empty