TITLE Instruction set program SUBTTL /This goes in .HEX file/ STAT EQU 2 ;PORT 2 HAS SYMBOLIC NAME STAT FALSE EQU 0 TRUE EQU NOT FALSE THIS EQU TRUE THAT EQU FALSE ORG 100H ;TELL MAC80 TO PLACE CODE AT 100 HEX ; OPT HEX ;HEX OUTPUT (THE DEFAULT) START: ACI 1 ;ALL THE INSTRUCTIONS IN ALPHABETICAL ORDER ADC C ADD B ADI 123 ANA M ANI 20 CALL MACROS CC START+1 ;EXAMPLES OF ADDRESS CALCULATIONS CM START-10H CMA CMC CMP B CNC START/2 CNZ (START*3)/3 CP (START/3)*3 CPI 2+3*4 CPE START MOD 10 CPO START AND 0FFH CZ LOW START DAA DAD H DB "Hello ","There",(RIM),(ADD C),(MOV A,M) DCR C DCX H DI DS (STAT*10)-1 DW 1,2,3,(RET) DZ "Hello There " EI HLT IN STAT INR A INX H JC -START JM START AND 0FF00H JMP HIGH START ;SAME AS (START AND 0FF00H)/100H JNC NOT START JNZ #START ;MEANS "NOT START" SEE DODATA ROUTINE JP -(START * STAT) JPE START JPO START-STAT JZ START!77Q LDA START OR 3FH LDAX B LHLD START LXI H,"ab" MOV A,M MVI B,(START-$-1) AND 0FFH NOP ORA B ORI LOW (START-$-1) ;SAME AS "AND 0FFH" OUT 5 PCHL POP B PRINTX This is the instruction set test PUSH H RAL RAR RC RET RIM RLC RM RNC RNZ RP RPE RPO RRC RST 5 RZ SBB D SBI "A" SHLD START SHR 2 SIM SPHL STA START SHL 3 STAX D STC SUB L SUI '"' ;QUOTES CAN BE ' OR " (AND IS REMEMBERED) XCHG XRA C XRI 4 XTHL IFE THIS ;IF ELSE ENDIF TESTS DB 1 ELSE DB 2 ENDIF IF THIS ;'IF' IS THE SAME AS 'IFN' DB 3 ELSE DB 4 ENDIF MAC1 MACRO ;MACRO TESTING DB "THIS IS A MACRO WITH NO ARGS" ;AND A COMMENT ENDM MAC2 MACRO A,B CALL B ;A COMMENT DB "2 ARGS" ;;AND A SUPPRESSED COMMENT ENDM MAC3 MACRO INSTR,TEXT ;... INSTR ;DO INSTR DB TEXT ENDM MACROS: MAC1 MAC2 FOO,START MAC3 ,<"ANGLE BRACKETS DELIMIT ANYTHING"> OPT SMAC ;SUPPRESS MACRO EXPANSION MAC1 OPT LMAC ;LIST MACRO EXPANSION MAC1 TABLE MACRO ;CLASSIC TABLE GENERATION MACRO X ABC X AAA X JKL X C90 ENDM X MACRO ARG DB "ARG" ENDM VALUES: TABLE X MACRO ARG DW ADR'ARG ENDM ADDRES: TABLE X MACRO ARG ;BE LAZY & MAKE ADDRESSES ALSO ADR'ARG: JMP START ENDM TABLE END START ;START ADDRESS OPTIONAL