📄 outp3.asm
字号:
.global outP3 .section cpu_dir, #alloc .word 'o'+'u'+'t'+'P'+'3'+'.'+'c'+'g'+'i' .byte 0x10 ;cgi .byte 0 ;reserved .word cgibegin .word cgiend .section cpu_files, #alloccgibegin: ;outP3.cgi .pcode outP3 .pcode pretcgiend: .textoutP3: jnb flagSecure,noExecCgi mov state80,#'3' ; find '3' item - out P3 lcall scanpar jnb zflag, no1cmd ;; cmdDdump8: mov r1,#8dump0: mov a,@r0 mov r7,a cjne r7,#'&',L9 ;ret form item separatornoExecCgi:no1cmd: retL9: cjne r7,#' ',L8 ret ;ret if space delimiterL8: anl a,#0b11100000 jnz L7 ret ;ret if control charL7: inc r0;get Hex parametr mov a,@r0 inc r0 jnb acc.6,L10 ;convert ascii to hex nibble add a,#9L10: anl a,#0x0F swap a mov r6,a mov a,@r0 inc r0 jnb acc.6,L11 ;convert ascii to hex nibble add a,#9L11: anl a,#0x0F orl a,r6 cjne r7,#'A',LnoAND ;AND_port command orl a,#0b11000000 ;don't change WR and RD pin anl P3,a sjmp LnextLnoAND: cjne r7,#'O',LnoOR ;OR_port command orl P3,a sjmp LnextLnoOR: cjne r7,#'X',LnoXOR ;XOR_port command anl a,#0b00111111 ;don't change WR and RD pin xrl P3,a sjmp LnextLnoXOR: cjne r7,#'S',no1cmd ;SET_port command orl a,#0b11000000 ;don't change WR and RD pin mov P3,aLnext: djnz r1,dump0; advance processed bytes forward and copy next fragment of parameters lcall scancont sjmp dump8 ;; END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -