New Project

; Simple include file - ; Select Main.dasm and click assemble to assemble the full program ; :screen_addr equ 0xe000 :char_addr equ 0xe180 :screen_width equ 32 nolist if screen_width != 32 error "screen width must be 32" end_if define jmp_ set pc, define push_ set push, list :cursor dat screen_addr + screen_width * 4 + 4 :colour dat 0x9100 :store_a dat 0 :store_b dat 0 ; Print out a zero terminated string immediately following the ; instruction that called this routine ; eg. jsr print ; dat "my String",0 ; ..code continues from here ; No registers are affected by this routine ; :print jmp_ print_start ; Move the cursor to the next line :newline jmp_ do_newline ; ; ; ; Set up the monitor, keyboard and clock ; At the moment, this simply initialises the screen buffer to ; a known address ; ; This uses registers a,b,c,x,y,i,j ; :setup jmp_ setup_hw ; ; System error is called if a fatal error occurs ; ; :system_error jmp_ system_error :setup_hw hwn i :hw_loop ife i, 0 set pc, hw_discovered sub i, 1 hwq i ife a, 0xf615 ife b, 0x7349 set [monitor_idx], i ife a, 0xb402 ife b, 0x12d0 set [clock_idx], i ife a, 0x7406 ife b, 0x30cf set [keyboard_idx], i set pc, hw_loop ; These are set up by the hardware discovery loop above: ; :NOT_FOUND equ 0xffff :monitor_idx dat NOT_FOUND ; Index of first monitor connected to cpu, or 0xffff :clock_idx dat NOT_FOUND ; Index of first clock connected to cpu, or 0xffff :keyboard_idx dat NOT_FOUND ; Index of first keyboard connected to cpu, or 0xffff ; Now set up the screen with default palette and font :hw_discovered ife [monitor_idx], NOT_FOUND set pc, system_error set a, 0 set b, screen_addr hwi [monitor_idx] set pc, pop ;----------------------------------------------- :do_newline set [store_a], a set a,[cursor] and a, 0xffe0 add a, screen_width set [cursor],a set a, [store_a] set pc, pop ;----------------------------------------------- :print_start set [store_a], a set [store_b], b set a, pop set b, [cursor] loop set [b], [a] add [b], [colour] add a,1 add b,1 ifn [a], 0 jmp_ loop add a,1 push_ a set a, [store_a] set b, [store_b] set pc, pop ; End of Kernel ;--------------------------------------------

; Example project - Now RC_1 compliant: ; ; This project demonstrates some of the basics of F1DE ; ; Note the use of ; Include - Include a file ; Org - Set the location of subsequent code (multiple orgs are supported) ; Equ - Constant equates ; Dat - Data expressions, ; Pack - Byte packed data ; Define - Simple text substitution ; If/Else - Conditional assembly ; List/Nolist - Turn assembly output on/off ; Macros - No parameters (yet!) ; ; Expressions are supported throughout, with full operator precendence. ; Available operators : + - * / % & | ^ ! ~ << >> ( ) ; ; Numeric literals are base 10 by default. Other radixes are: ; 0xABCD - Hex, 0b10111 - Binary, 0o756 - Octal ; ; Multiple pass assembly uses short form addresses where possible ; ; org 0x000 set pc, start include "kernel.dasm" org 0x200 :start jsr setup set a, 1 add a, 5 jsr print dat "Hello there!", 0 jsr newline jsr print dat "F1DE is RC_1 compliant", 0 :end set pc,end dat "Strings" pack "Byte packed data", 1,2,3

Name

Name

copy current project files

NOTE: You do not need to save to assemble a project. Just click assemble.

Name

This is a public project. If you wish to save your changes, you must fork it. This will create a new project from your changes, that you alone will be able to edit.