Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "kernel.inc"
- #include "corelib.inc"
- .db "KEXC"
- .db KEXC_ENTRY_POINT
- .dw start
- .db KEXC_STACK_SIZE
- .dw 20
- .db KEXC_NAME
- .dw name
- .db KEXC_HEADER_END
- name:
- .db "hello_world", 0
- start:
- ; This is an example program, replace it with your own!
- kld(de, corelib_path)
- pcall(loadLibrary)
- ; Get a lock on the devices we intend to use
- pcall(getLcdLock)
- pcall(getKeypadLock)
- ; Allocate and clear a buffer to store the contents of the screen
- pcall(allocScreenBuffer)
- pcall(clearBuffer)
- kld(hl, window_title)
- xor a
- corelib(drawWindow)
- call sub
- .loop:
- ; Copy the display buffer to the actual LCD
- pcall(fastCopy)
- ; flushKeys waits for all keys to be released
- pcall(flushKeys)
- ; waitKey waits for a key to be pressed, then returns the key code in A
- ;pcall(waitKey)
- corelib(appWaitKey)
- cp kMODE
- jr nz, .loop
- ; Exit when the user presses "MODE"
- ret
- sub:
- ret
- corelib_path:
- .db "/lib/core", 0
- window_title:
- .db "Hello World", 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement