با سلام
من برنامه چراغ راهنما را به زبان اسمبلی میخام. (8086)
البته میخام وقفه هاش زیاد باشه
با تشکر
با سلام
من برنامه چراغ راهنما را به زبان اسمبلی میخام. (8086)
البته میخام وقفه هاش زیاد باشه
با تشکر
اگر از emulator استفاده کنی خودش توی مثالهاش داره اینم کدش هست
#MAKE_BIN#
#CS = 500#
#IP = 0#
; This is a sample of OUT instruction.
MOV AX, 1
next_situation:
OUT 4, AX
ROL AX, 1 ; rotate bit.
JMP next_situation
ببخشید چرا این برنامه داخل emu8086 را که اجرا می کنم. 4 تا چراغ راهنما داره. مگه خود برنامه مربوط به یک چراغ نیست؟
یکی به من کمک کنه!!!!!
با سلام خدمت دوست گرامي !
اميدوارم اين برنامه به دردتون بخوره
; controlling external device with 8086 microprocessor.
; realistic test for c:\emu8086\devices\Traffic_Lights.exe
#start=Traffic_Lights.exe#
name "traffic"
mov ax, all_red
out 4, ax
mov si, offset situation
next:
mov ax, [si]
out 4, ax
; wait 5 seconds (5 million microseconds)
mov cx, 4Ch ; 004C4B40h = 5,000,000
mov dx, 4B40h
mov ah, 86h
int 15h
add si, 2 ; next situation
cmp si, sit_end
jb next
mov si, offset situation
jmp next
; FEDC_BA98_7654_3210
situation dw 0000_0011_0000_1100b
s1 dw 0000_0110_1001_1010b
s2 dw 0000_1000_0110_0001b
s3 dw 0000_1000_0110_0001b
s4 dw 0000_0100_1101_0011b
sit_end = $
all_red equ 0000_0010_0100_1001b
با سلام
اين هم يك مدل ديگه از همين برنامه است
; Traffic ligts test 2 for
; c:\emu8086\devices\Traffic_Lights.exe
; This is just an example of how to set the lights,
; better if you run it in step-by-step mode.
; DO NOT RUN AT MAXIMUM SPEED, DO NOT USE REAL CARS.
;)
#start=Traffic_Lights.exe#
name "traffic2"
yellow_and_green equ 0000_0110b
red equ 0000_0001b
yellow_and_red equ 0000_0011b
green equ 0000_0100b
all_red equ 0010_0100_1001b
start:
nop
; 0,1,2
mov ax, green
out 4, ax
mov ax, yellow_and_green
out 4, ax
mov ax,red
out 4, ax
mov ax, yellow_and_red
out 4, ax
; 3,4,5
mov ax, green << 3
out 4, ax
mov ax, yellow_and_green << 3
out 4, ax
mov ax,red << 3
out 4, ax
mov ax, yellow_and_red << 3
out 4, ax
; 6,7,8
mov ax, green << 6
out 4, ax
mov ax, yellow_and_green << 6
out 4, ax
mov ax,red << 6
out 4, ax
mov ax, yellow_and_red << 6
out 4, ax
; 9,A,B
mov ax, green << 9
out 4, ax
mov ax, yellow_and_green << 9
out 4, ax
mov ax,red << 9
out 4, ax
mov ax, yellow_and_red << 9
out 4, ax
; all
mov ax, all_red
out 4, ax
mov ax, all_red << 1 ; all yellow
out 4, ax
mov ax, all_red << 2 ; all green :)
out 4, ax
jmp start