mov ax, bx drama story

mov ax, bx drama story – for fun and fasm

; build:
; fasm love_registers.asm love_registers.exe

format PE GUI 4.0
entry start

include ‘win32a.inc’

section ‘.data’ data readable writeable
title db ‘Register Drama’, 0
msg db ‘BX whispered: “take my value…”‘, 13, 10
db ‘AX blushed and replied: mov ax, bx’, 13, 10, 13, 10
db ‘Now AX and BX are in a serious relationship.’, 0

section ‘.code’ code readable executable

start:
; BX was a rich register
mov bx, 0BEEFh

; AX had nothing except hope
xor ax, ax

; The most romantic moment in the program
mov ax, bx

; Now AX is BEEF too. True love is just copying bits.
invoke MessageBox, 0, msg, title, MB_OK or MB_ICONINFORMATION

invoke ExitProcess, 0

section ‘.idata’ import data readable writeable

library kernel32, ‘KERNEL32.DLL’, \
user32, ‘USER32.DLL’

import kernel32, \
ExitProcess, ‘ExitProcess’

import user32, \
MessageBox, ‘MessageBoxA’

Comments are closed.