ntsys/examples/wait.asm
2026-03-20 15:01:44 +04:00

26 lines
1.8 KiB
NASM
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

main: ; Метка main
push.string "This is example of wait!\n" ; Строка
push byte, 0x00 ; Номер
syscall ; Системный вызов
mload: ; Функция mload
push word, 0x00 ; Данные для записи
push word, 0x00 ; Адрес в VRAM
mwrt word ; Комманда записи
lwait: ; Цикл задержки
push db, lwait ; Его адрес
push word, 0x01 ; Увеличивать счетчик на 1
push word, 0x00 ; Счетчик по адресу 0x00
mread word ; Читаем
add word ; Складываем
push word, 0x00 ; Адрес для записи
mwrt word ; Записываем обратно
push word, 0x00 ; Адрес
mread word ; Читаем
push word, 0xFFFF ; Значение для сравнения
neq word ; Если не равно - повторить цикл
mloop: ; Главный цикл
push db, main ; Адрес main
jmp ; Повторяем цикл