Go Back   Gaming Gutter > Non-Gaming > Programming > Source Code


Source Code - Have a source code/project files you want to post? Do so here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» GG Stuff

Follow us on Twitter!

Get the GG toolbar today (for firefox only)
» Recent Threads
Go to first new post Post Your Picture (Read...
10-09-2006 11:34 PM
by Ryan
Last post by Fran
Today 06:08 PM
14,263 Replies, 247,442 Views
Go to first new post MMMMMMHMMMMMM HONEY BEE
03-13-2010 06:52 PM
by samstah
Last post by Fran
Today 06:01 PM
9 Replies, 105 Views
Go to first new post Mexican Immigration
Today 04:19 PM
by Army
Last post by Army
Today 06:00 PM
2 Replies, 4 Views
Go to first new post help
Today 05:31 PM
Last post by Army
Today 05:58 PM
1 Replies, 2 Views
Go to first new post What are you currently...
09-12-2008 03:16 PM
by Ocean
Last post by Army
Today 05:58 PM
2,950 Replies, 23,862 Views
Reply
 
LinkBack Thread Tools Display Modes

 [ASM] Simple Calculator
Old 07-07-2009, 02:12 PM   #1 (permalink)
Banned

Male Checker is offline
 
Join Date: Feb 2008
Posts: 2,646
GPoints: 1,626
iTrader: 8 / 100%
Checker - Total CelebrityChecker - Total CelebrityChecker - Total CelebrityChecker - Total CelebrityChecker - Total CelebrityChecker - Total Celebrity
Rep Power: 0
[ASM] Simple Calculator

Code:
	       TITLE   CALC
CGROUP	       GROUP   CODESEG
CODESEG        SEGMENT PARA PUBLIC 'CODE'
	       ASSUME  CS:CGROUP,DS:CGROUP,ES:CGROUP
	       PUBLIC  CALC

	       ORG     100H

CALC	       PROC    FAR
	       JMP     START

;-------------------------------------…
;								      ;
;			     DATA AREA				      ;
;								      ;
;-------------------------------------…

	       DB      'INTERRUPT NUMBER ='
INT_NUMBER     DB      61h

SCREEN_HANDLE  DW      0001h

MESSAGE        DB      'PEMATH is not resident',13,10
MESSAGE_LEN    EQU     $-MESSAGE

TAG	       DB      'PEMATH'
TAG_LEN        EQU     $-TAG

;-------------------------------------…
;								      ;
;			     CODE AREA				      ;
;								      ;
;-------------------------------------…

START:
;-------------------------------------…
;    TEST FOR PRESENCE OF CALCULATOR				      ;
;-------------------------------------…
	       SUB     AX,AX
	       MOV     ES,AX
	       SUB     BH,BH
	       MOV     BL,INT_NUMBER
	       SHL     BX,1
	       SHL     BX,1
	       MOV     DI,ES:[BX]
	       MOV     ES,ES:[BX+2]
	       ADD     DI,4
	       LEA     SI,TAG
	       MOV     CX,TAG_LEN
	 REPE  CMPSB
	       JE      CALL_CALC
	       MOV     BX,SCREEN_HANDLE
	       MOV     CX,MESSAGE_LEN
	       LEA     DX,MESSAGE
	       MOV     AH,40h
	       INT     21h
	       JMP     SHORT CALC_EXIT
;-------------------------------------…
;    CALL CALCULATOR						      ;
;-------------------------------------…
CALL_CALC:
	       MOV     AL,INT_NUMBER
	       MOV     BYTE PTR INT_CODE,AL
	       DB      0CDh	  ; INT
INT_CODE:
	       DB      00h
	       NOP
	       NOP

CALC_EXIT:
	       INT     20h

CALC	       ENDP

CODESEG        ENDS
	       END     CALC
  Reply With Quote

 
Old 07-07-2009, 08:31 PM   #2 (permalink)
wonoes

Male Personoid xX is offline
 
Personoid xX's Avatar
 
Join Date: Sep 2008
Location: In SciTe
Posts: 1,304
GPoints: 16,183
iTrader: 0 / 0%
Personoid xX Is a Lord of AwesomenessPersonoid xX Is a Lord of AwesomenessPersonoid xX Is a Lord of AwesomenessPersonoid xX Is a Lord of Awesomeness
Rep Power: 10
Never mind. I feel like a Nub.
__________________





Quote:
Originally Posted by Cake
Quote:
Originally Posted by Fork
is it hot in here or is it just me?
no that's personoid

Last edited by Personoid xX; 07-07-2009 at 08:43 PM..
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Powered by vBadvanced CMPS v3.1.0

All times are GMT -7. The time now is 06:14 PM.


vBulletin skin developed by: eXtremepixels
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.22765589 seconds (100.00% PHP - 0% MySQL) with 21 queries