WRI Colleges Alumni Forum
Hello WRIans...

If you are not a member yet, please register with complete information to be able to post, reply and to create thread or topics in the forum.

Madya na po kita!!

Login with FACEBOOK is now available for facebook users.


[Admin]
Please notify or send an SMS to forum admin @09501527151 for activation of your account.
Welcome...... Alumni of Naga, Rinconada, Calabanga, Partido and Sorsogon....
Alumni of the WRI-Goa Branch is planning to have a simple Alumni Reunion on 2018. Please text 09501527151 for attendance.
We are looking for Forum Moderator from other branches; Naga, Rinconada, Calabanga and Sorsogon Alumni. Salamat.
Search
Display results as :
Advanced Search
December 2017
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Calendar

Latest topics
alumni reunion... Thu Nov 30, 2017 6:33 pmarvie21
Annyeong-haseyoThu Nov 30, 2017 6:28 pmarvie21
hello.... good daySun Nov 19, 2017 6:59 pmChelleAnn
Forum Rules and GuidelinesSun Nov 19, 2017 3:36 pmradax
Uploading of Images and VideosSun Nov 19, 2017 3:34 pmradax
What is PROTOCOL?Sat Jul 29, 2017 6:17 pmradax
Pa-Raffle 2010 @ WRI-Goa GroundMon Jul 17, 2017 8:20 pmradax
Forum Rules & GuidelinesMon Jul 17, 2017 8:17 pmradax
Forum Group SynchronizationMon Jul 17, 2017 8:12 pmradax
The Sportsfest 2014Wed Mar 19, 2014 10:18 amradax
kumusta? goanians???? Thu Mar 13, 2014 10:19 pmGuest
WRI Foundation 2014 at SM City NagaMon Mar 10, 2014 11:47 amGuest
hi everyone..Mon Mar 03, 2014 12:37 pmradax
Care and maintenance of Leather furnitureMon Oct 28, 2013 5:14 pmGuest
Consider the filling of the sofaFri Oct 25, 2013 5:12 pmGuest
Conversion Dining Top for Pool TableTue Oct 22, 2013 4:48 pmGuest
Antique Writing DesksMon Oct 21, 2013 5:01 pmGuest
Take care of your wooden outdoor furniture Sat Oct 19, 2013 4:39 pmGuest
Cooking FeastSat Aug 27, 2011 3:18 pmmherlcan
wri-calabangaFri Jul 08, 2011 6:02 pmrickzmanansala
Have a nice day WriansTue Jul 05, 2011 12:12 pmrickzmanansala
hi po sir danSun Jul 03, 2011 3:48 pmrickzmanansala
asar talaga.. Sun Jul 03, 2011 3:48 pmrickzmanansala
Saang Branch ka ba?Sun Jul 03, 2011 3:34 pmrickzmanansala
WRI Intramurals 2010Thu Nov 04, 2010 4:35 pmmherlcan
What is a Protocol?Tue Oct 26, 2010 12:00 pmBlex
What is a Network?Tue Oct 26, 2010 11:59 amGuest
How to crimp a cable RJ45Tue Oct 26, 2010 11:39 amGuest
Troubleshooting Your Phone LineTue Oct 26, 2010 11:24 amBlex
General printer troubleshooting.Tue Oct 26, 2010 11:08 amGuest
kelan po ba ang intrams ng WRI-Goa?Tue Oct 12, 2010 10:10 amGuest
ehem...Sun Sep 19, 2010 4:35 pmGuest
rationalTue Sep 07, 2010 7:07 amarvie21
Pagsungko ni INA (2010)Sat Sep 04, 2010 1:49 pmGuest
WRI-GOA STARTING POINT...Fri Sep 03, 2010 1:37 amarvie21
WRI-Goa Alumni EventsSun Aug 29, 2010 11:53 amBlex
kumusta wrians?Sun Aug 15, 2010 10:23 pmbonnkeivy
Basic PC AssemblySun Aug 08, 2010 6:59 pmGuest
Propaganda TechniquesSun Aug 08, 2010 6:32 pmGuest
Good news for WRIFri Jan 22, 2010 10:08 amradax
Tictactoe in C++Wed Dec 16, 2009 2:29 amviraxz
WRI Goa momentsThu Dec 10, 2009 3:15 pmGuest
help me my friends.. :DThu Dec 10, 2009 3:01 pmGuest
To all WRIan Graduates...Thu Dec 10, 2009 2:03 pmGuest
Shaker Sort ANSI CTue Dec 08, 2009 4:52 pmjcodee
Alumni Date on the making..Sat Nov 28, 2009 12:02 pmBlex
Simple Calculator in VBFri Nov 27, 2009 6:49 pmGuest
Planning for WRI AlumniThu Nov 26, 2009 11:22 pmGuest
WRI SorsogonFri Nov 20, 2009 2:34 amradax
To all WRIans...Mon Nov 16, 2009 9:12 pmmeowchi
Online Forum MeetingSat Nov 14, 2009 2:31 pmmeowchi
Merry Christmas..Sat Nov 14, 2009 2:28 pmmeowchi
Calling all WRI Graduates!Thu Nov 12, 2009 6:40 pmmeowchi
Updated WRIans Forum SiteFri Nov 06, 2009 4:19 amradax
Pictures of WRIWed Nov 04, 2009 4:08 pmmeowchi
List of names of WRI GraduatesMon Oct 26, 2009 11:11 amradax
Who is online?
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest

None

Top posters
157 Posts - 43%
42 Posts - 12%
25 Posts - 7%
23 Posts - 6%
23 Posts - 6%
21 Posts - 6%
20 Posts - 6%
20 Posts - 6%
19 Posts - 5%
13 Posts - 4%
Page Hits
reset 12/3/2017


Share
View previous topicGo downView next topic
avatar
jcodee
Inactive forumer
Inactive forumer
Posts : 3
Join date : 2009-11-06
Age : 39
Home Address : AUH, United Arab Emirates

default OS LOADER - Sorry wala section for assemblers kaya dito na lang

on Tue Dec 08, 2009 4:56 pm
#make_bin#
#load_segment=0800#
#load_offset=0000#

#al=0b#
#ah=00#
#bh=00#
#bl=00#
#ch=00#
#cl=02#
#dh=00#
#dl=00#
#ds=0800#
#es=0800#
#si=7c02#
#di=0000#
#bp=0000#
#cs=0800#
#ip=0000#
#ss=07c0#
#sp=03fe#



putc macro char
push ax
mov al, char
mov ah, 0eh
int 10h
pop ax
endm


gotoxy macro col, row
push ax
push bx
push dx
mov ah, 02h
mov dh, row
mov dl, col
mov bh, 0
int 10h
pop dx
pop bx
pop ax
endm


print macro x, y, attrib, sdat
LOCAL s_dcl, skip_dcl, s_dcl_end
pusha
mov dx, cs
mov es, dx
mov ah, 13h
mov al, 1
mov bh, 0
mov bl, attrib
mov cx, offset s_dcl_end - offset s_dcl
mov dl, x
mov dh, y
mov bp, offset s_dcl
int 10h
popa
jmp skip_dcl
s_dcl DB sdat
s_dcl_end DB 0
skip_dcl:
endm



org 0000h

jmp start




;==== data section =====================

msg db 'os loader open!', 0

cmd_size equ 10
command_buffer db cmd_size dup('b')
clean_str db cmd_size dup(' '), 0
prompt db '>', 0

chelp db 'help', 0
chelp_tail:
ccls db 'cls', 0
ccls_tail:
cquit db 'quit', 0
cquit_tail:
cexit db 'exit', 0
cexit_tail:
creboot db 'reboot', 0
creboot_tail:

help_msg db 'OS Loader!', 0Dh,0Ah
db 'console commands:', 0Dh,0Ah
db 'help - print list.', 0Dh,0Ah
db 'cls - clear scr', 0Dh,0Ah
db 'reboot - reboot the machine.', 0Dh,0Ah
db 'quit - reboot.', 0Dh,0Ah
db 'exit - quit.', 0Dh,0Ah
db 'mods', 0Dh,0Ah, 0

unknown db 'unknown command: ' , 0

;======================================

start:

; data segment:
push cs
pop ds

; video mode
mov ah, 00h
mov al, 03h
int 10h

; prompt emulators
mov ax, 1003h
mov bx, 0
int 10h


call clear_screen

lea si, msg
call print_string


eternal_loop:
call get_command

call process_cmd

jmp eternal_loop


;===========================================
get_command proc near

mov ax, 40h
mov es, ax
mov al, es:[84h]

gotoxy 0, al

lea si, clean_str
call print_string

gotoxy 0, al

lea si, prompt
call print_string


mov dx, cmd_size ; buffer size.
lea di, command_buffer
call get_string


ret
get_command endp
;===========================================

process_cmd proc near

push ds
pop es

cld ; forward compare.

lea si, command_buffer
mov cx, chelp_tail - offset chelp ; size of ['help',0] string.
lea di, chelp
repe cmpsb
je help_command

lea si, command_buffer
mov cx, ccls_tail - offset ccls ; size of ['cls',0] string.
lea di, ccls
repe cmpsb
jne not_cls
jmp cls_command
not_cls:

lea si, command_buffer
mov cx, cquit_tail - offset cquit ; size of ['quit',0] string.
lea di, cquit
repe cmpsb
je reboot_command

lea si, command_buffer
mov cx, cexit_tail - offset cexit ; size of ['exit',0] string.
lea di, cexit
repe cmpsb
je reboot_command

lea si, command_buffer
mov cx, creboot_tail - offset creboot ; size of ['reboot',0] string.
lea di, creboot
repe cmpsb
je reboot_command


mov al, 1
call scroll_t_area

mov ax, 40h
mov es, ax
mov al, es:[84h]
dec al
gotoxy 0, al

lea si, unknown
call print_string

lea si, command_buffer
call print_string

mov al, 1
call scroll_t_area

jmp processed

mov al, 9
call scroll_t_area

mov ax, 40h
mov es, ax
mov al, es:[84h]
sub al, 9
gotoxy 0, al

lea si, help_msg
call print_string

mov al, 1
call scroll_t_area

jmp processed

cls_command:
call clear_screen
jmp processed


reboot_command:
call clear_screen
print 5,2,0011_1111b," eject floppy disks "
print 5,3,0011_1111b," press any key to reboot... "
mov ax, 0 ; wait for any key....
int 16h

;boot values
mov ax, 0040h
mov ds, ax
mov w.[0072h], 0000h

jmp 0ffffh:0000h


processed:
ret
process_cmd endp


scroll_t_area proc near

mov dx, 40h
mov es, dx
mov ah, 06h
mov bh, 07
mov ch, 0
mov cl, 0
mov di, 84h
mov dh, es:[di]
dec dh
mov di, 4ah
mov dl, es:[di]
dec dl
int 10h

ret
scroll_t_area endp

get_string proc near
push ax
push cx
push di
push dx

mov cx, 0

cmp dx, 1
jbe empty_buffer

dec dx


wait_for_key:

mov ah, 0
int 16h

cmp al, 0Dh
jz exit


cmp al, 8
jne add_to_buffer
jcxz wait_for_key
dec cx
dec di
putc 8
putc ' '
putc 8
jmp wait_for_key

add_to_buffer:

cmp cx, dx
jae wait_for_key

mov [di], al
inc di
inc cx

mov ah, 0eh
int 10h

jmp wait_for_key

exit:

; null term
mov [di], 0

empty_buffer:

pop dx
pop di
pop cx
pop ax
ret
get_string endp




print_string proc near
push ax
push si

next_char:
mov al, [si]
cmp al, 0
jz printed
inc si
mov ah, 0eh
int 10h
jmp next_char
printed:

pop si
pop ax

ret
print_string endp



clear_screen proc near
push ax
push ds
push bx
push cx
push di

mov ax, 40h
mov ds, ax
mov ah, 06h
mov al, 0
mov bh, 1001_1111b
mov ch, 0
mov cl, 0
mov di, 84h
mov dh, [di]
mov di, 4ah
mov dl, [di]
dec dl
int 10h

mov bh, 0
mov dl, 0
mov dh, 0
mov ah, 02
int 10h

pop di
pop cx
pop bx
pop ds
pop ax

ret
clear_screen endp
Guest
Guest

default Re: OS LOADER - Sorry wala section for assemblers kaya dito na lang

on Wed Dec 09, 2009 5:52 am
hmmm.,, di ko alam to ah... hek..
View previous topicBack to topView next topic
Permissions in this forum:
You cannot reply to topics in this forum