Assembly to Machine Language Converter for MC6800/MC6808/HERO-1 - v.3.93
Converts mnuemonic assembly code with labels, constants, etc. Returns machine language code. Includes Hero-1 Robot Language codes, motor and port constants, address constants, and more.
To use, enter assembly code in the big text box below and click GENERATE
; simple Hero-1 program ; start the program by running at 0080 (hex) ; comments always prefixed with semicolon ; ; constants always prefixed with # ; offset argument for indexed ops always prefixed with + OR , before constant ; you must have a space, however, after the mneumonic instruction and ; before the + or , ; $ = hex number; % = binary number; otherwise decimal ; _ may be used in any constant as visual separators ; use ORG to align to specific address space(s) MyHexConstant CON $80 MyDecConstant CON 128 MyBinConstant CON %1000_1111 MyWordConstant CON $80_80 ; note that you MUST have SPACES in all ; evaluated constants ; you may NOT use constants in constants, sorry ; you may use nested parentheses, but put spaces between everything ; & AND ; ^ XOR ; >> shift left ; | OR ; + plus ; - or neg ; * multiply ; / divide MyEvalConst1 CON ( %0001_0000 >> 4 ) MyEvalConst2 CON ( 256 / 2 ) MyEvalConst3 CON ( $100 / 2 ) MyEvalConst4 CON ( 4 * 4 ) MyEvalConst5 CON ( $FF & $F ) MyEvalConst7 CON ( $FFFF - 16 ) MyEvalConst8 CON ( ( %0001_0000 >> 4 ) * 2 ) ; -------------------------- ORG $0060 __PARAM1: DATA #0 __PARAM2: DATA #0 __PARAM3: DATA #0 __PARAM4: DATA #0 __PARAM5: DATA #0 ; -------------------------- ORG $0070 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 DATA #0 ; -------------------------- ORG $0080 ; -------------------------- Start: JSR _MachLang ROBOTLANG LIGHTEN ; enable light detector MACHLANG ; -------------------------- Main: JSR CLRDIS ; clear display, address constant LDAA LIGHTSOUNDADC ; load ACCA from light/sound port JSR OUTBYT ; print byte on display ROBOTLANG PAUSE #4 ; pause a constant amount MACHLANG BRA Main ; -------------------------- Other_Examples: LDAA #MyDecConstant ; load immediately with a constant LDAA Start ; loading from labeled address LDAA $10 ; loading from constant hex address LDAA 16 ; loading from constant dec address LDAA SONARHITS ; loading from constant address, optimized if direct LDAA LIGHTSOUNDADC ; same, but auto-extended LDAA #$10 ; loading hex immediately LDAA #16 ; loading decimal immediately LDAA #%0001_1110 ; loading binary immediately LDX #POSGRIP ; load index reg. with const. LDAA ,#$00 ; load A indexed, using const. offset of 0 LDAB ,#$01 ; load B indexed, using const. offset of 1 BRA Other_Examples BRA Do_Data Data_Label1: DATA #0 Data_Label2: DATA #1 Do_Data: LDAA Data_Label3 LDAB Data_Label2 LDAA Data_Label1 LDAA Data_Label4 ; errors as label does not exist BRA Do_Data ; -------------------------- ORG $0100 Data_Label3: DATA #0 ORG $0110 _MachLang: LDAA REPEATMODE CMPA #ROBOTLANGON BNE _MachLangDone MACHLANG _MachLangDone: RTS Cheap_Multiply: ; must be in mach lang or will be slow ; ACCB * ACCA STAA __PARAM5 CLRA Mult_Repeat: TST __PARAM5 BEQ Mult_Done ABA DEC __PARAM5 BRA Mult_Repeat Mult_Done: ; result in A RTS Get_Time: CLI LDAB #CLOCKRTC STAB CLOCK LDAB #RTC_SEL_SEC_01 STAB RTCSEL LDAA CLOCK STAA $40 INCB ; 10 seconds STAB RTCSEL LDAA CLOCK STAA $41 INCB ; 1 minutes STAB RTCSEL LDAA CLOCK STAA $42 INCB ; 10 minutes STAB RTCSEL LDAA CLOCK STAA $43 INCB ; 1 hours STAB RTCSEL LDAA CLOCK STAA $44 INCB ; 10 hours STAB RTCSEL LDAA CLOCK ANDA #RTC_HRS_10_MASK STAA $45 ; now multiply for real hours LDAB $45 LDAA #10 JSR Cheap_Multiply ; a * b into a STAA $46 RTS
©2010 - 2025 1uffakind Design / c. goldsmith