Assembler release TER_2.0 version 2.09 (c) Motorola (free ware) main.asm, line no. 42: warning:can't open INCLUDE file Output.asm 0001 ;**************************** 0002 ; Main.asm 0003 ; 0004 ; Main program 0005 ;**************************** 0006 0007 IFND GLOB_DAT 0000 include ;pick up globals 0001 ;************************************ 0002 ; Global_Dat.i 0003 ; 0004 ; Global Variables & Data 0005 ;*********************************** 0006 0007 0001 GLOBAL_DAT EQU 1 ;to prevent further inclusion 0008 0009 OPT p50 ;page breaks 0010 0011 ;Memory Map 0012 0013 CODE 0014 E000 ORG $E000 ;set CODE 0015 DATA 0016 F800 ORG $F800 ;set data 0017 BSS 0018 0040 ORG 64 ;set static variable RAM 0019 0020 0021 0022 ;Global Definitions/Equates 0023 0024 0001 BYTE EQU 1 0025 0002 WORD EQU 2 0026 0002 APTR EQU 2 0027 0000 EOS EQU 0 ;end of string 0028 0029 ;Global Variables 0030 0031 0040 Acc1: RMB WORD 0032 0042 Acc2: RMB WORD 0033 Glob_Dat.i page 2 0035 ;Global Structures 0036 0037 DATA ;set PC to data area 0038 0039 ;Device control register tables 0040 ; each entry is struct Hware where: 0041 0042 ;struct Hware definitiion 0043 0000 U_Limit EQU 0 ;upper limit 0044 0001 L_Limit EQU U_Limit+BYTE ;lower limit 0045 0002 HErr_Msg EQU L_Limit+BYTE ;*high error message 0046 0004 LErr_Msg EQU HErr_Msg+APTR ;*low error message 0047 0006 Handler EQU LErr_Msg+APTR ;*handler 0048 0008 SizeOfHware EQU Handler+APTR 0049 0050 Reg_Table: ;struct Hware(s) declaration 0051 F800 FF 0A FCB $FF,10 ;struct Hware Reg1 0052 F802 F8 19 F8 26 E0 27 FDB Vy_Low_Msg,High_Msg,Handler1 0053 0054 F808 64 00 FCB 100,0 ;struct Hware Reg2 0055 F80A F8 10 F8 26 E0 28 FDB Low_Msg,High_Msg,Handler2 0056 0057 ; etc. 0058 0059 ;Global Data 0060 0061 F810 54 6F 6F 20 6C 6F Low_Msg: FCC 'Too low!' 77 21 0062 F818 00 FCB EOS 0063 F819 57 61 79 20 74 6F Vy_Low_Msg: FCC 'Way too low!' 6F 20 6C 6F 77 21 0064 F825 00 FCB EOS 0065 F826 57 61 79 20 74 6F High_Msg: FCC 'Way too high!' 6F 20 68 69 67 68 21 0066 F833 00 FCB EOS 0067 0008 end 0009 ENDIF 0010 0011 CODE ;set PC to next code area 0012 0013 E000 B6 F8 34 Start: ldaa Reg_dat.m ;data for hardware 0014 E003 F6 F8 35 ldab First.m ;register # 0015 E006 BD E0 1C jsr Output 0016 0017 E009 F6 F8 36 ldab Second.m ;reg # 0018 E00C BD E0 1C jsr Output 0019 0020 E00F 86 FF ldaa #$FF ;nonsense busy loop 0021 E011 B7 00 00 staa Scratch1 ;to use RAM 0022 E014 7A 00 00 Loop@: dec Scratch1 0023 E017 26 FB bne Loop@ 0024 0025 E019 7E E0 00 jmp Start ;get the cables, George main.asm page 3 0026 0027 ;local static data 0028 0029 DATA ;set PC to next data area 0030 F834 C8 Reg_dat.m: FCB #200 ;register data 0031 F835 00 First.m: FCB 0 ;reg nos. 0032 F836 01 Second.m: FCB 1 0033 0034 ;local dynamic data 0035 0036 AUTO 0037 0000 ORG 0 ;auto area 0038 0039 0000 Scratch1: RMB BYTE 0040 0001 Scratch2: RMB WORD 0041 main.asm, line no. 42: warning:can't open INCLUDE file Output.asm 0042 include 0043 0044 IFND OUTPUT 0000 include 0001 ;*********************************** 0002 ; Subroutine Dummy Output 0003 ; 0004 ; Send data where it belongs 0005 ;*********************************** 0006 0007 IFND GLOBAL_DAT 0008 include 0009 ENDIF 0009 ENDIF 0010 0011 CODE ;get code PC back 0012 0013 E01C FE F8 00 Output: ldx Reg_Table ;get pointer to table 0014 E01F 36 psha ;save data 0015 E020 86 08 ldaa #SizeOfHware ;find offset 0016 E022 3D mul 0017 E023 3A abx ;add offset to pointer 0018 E024 32 pula ;recover data 0019 E025 6E 06 jmp Handler,x ;goto Handler 0020 0021 Handler1: 0022 ;do handling 0023 E027 39 rts 0024 0025 Handler2: 0026 ;do handling of second sort 0027 E028 39 rts 0028 0029 AUTO ;goto auto area D_Output.asm page 4 0030 0000 ORG 0 ;same ORG cuz same area 0031 0032 0000 Itch1: RMB BYTE 0033 0001 Itch2: RMB BYTE 0034 0045 end 0046 ENDIF 0047 0048 end Program + Init Data = 96 bytes Error count = 0