Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
25 views
16 pages
Coal Labs
computer orgainzation
Uploaded by
Muhammad Abubakar
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save coal_labs For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
25 views
16 pages
Coal Labs
computer orgainzation
Uploaded by
Muhammad Abubakar
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save coal_labs For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save coal_labs For Later
You are on page 1
/ 16
Search
Fullscreen
RCL (Rot B is shifted Into the bs = words. RCL wo $ 's shifte wonts, RCL works fi cra ged Sma is: RCL AN RCL destination to the lef. into the rightmost bit, the citcle of bits being, destination, | destination, CL, sty Right (RCR): Hon RCR (Rotate throu; ‘gh Carry Right) Works just like RCL, ‘except that the bits are * she Hight See Figure. The symtan ee RCR destination, | AND RCR destination, CL Task 7.1 Programming Practice Q.1 Wa s ssembly language code to Print whether the number is ev odd negative. ample Executio} ENTER NUMBER: 8 IT IS EVEN POSITIVE boos Bt ee ah cUch 3, Lt i Int Ath 3, °Tt ie Main end P a Mov AX of fsct'v END Maiyy ot Pee ‘a int ah & data SMP Exit tod BIL bx, C ONEG SMP OPOS aPac.ue. Q.2 Write an assembly language code that will display number of O's and 1°s in a charac, by a user. oy \P ADDON = INC CONT LOOP Check. bo wd“ : 2; Numbes gy Osarnt mel’ CONT dB oo ADD dO,Ug Moy @ah,b Proc NT yh 0X @dola Moy ah 4 ds, ax mou dy offs v3 mov ah, 4 INT ath mou dy offset wh mev CLicoNnT iad sth Mov b2Q,.8 muy SLB bic 9 ah | mov do, b0 doth App dd, 4s roy bho Mow ah, 2 mov cx, TNT alh Check : ce abu ach , int alh Rol BL, | biog ech tec SC ADDN TNT ath LOOP Ey chypce Maw suppLAB #8 | Theory: Number System Conversions Practice the code of Binary Input, Binary Output, Hexa Input, Hexa Output and Petr tg following tasks. Task 8.1: Programming Practice O.1 Write an assembly language code that wil input a hex digit fom user and wil ony binary and will also display it in binary. 4 Sample Execution: ENTER A HEX DIGIT: A IN BINARY IT IS: 01000010 print s «model small Mov dQ, ‘o * Stack ooh sdalan test bY soocodoob ae. Enter a Hex digh B Posey A Main Proce int all ™ev ax, @deda She Rt ™ov ds, ay Oop pint mov ahiq mov al, “Vy mov dx opfcet WL int Wh Int Uh mov ah Yeh mov al, | int uh \nt ath ‘ Main end bi, | ee Ehd Main . mov dx lO mev ah, v PONE int 2} mov AK) |3 MoV ah) 2d int ah Bamov cx2. ~avbly language code that will input a binary number from user and will convert it ‘will also display it in hex digit, ENTER BID RY: 01000010, IN HEXA IT IS: A ocel smal! Jooh lata UL db “Enter Biro .¢ 2 dle TIS“TN Heya tt ised” JeRINT s veo mov alibh Main Proc sue lly | mov ax, @dota oR al! mov ds,ax SiR dl, | mov ah, SHR hy _ mov dx offset vi cMP Al, 4 | iat th TLE Numbes. | OR bx bx add all, SS mov ah, | SMe Dispky Y Numba « INPUT: . |) int ay add al, 4g ie Display : LL CMP od \\ ‘ott ad, , SE END ROL bx, | i” - | SHL bx, Rot bx, | , Rol bx) Sub ol 4? Ro. A) PRINT OR bh, al Loe PENTAssignment # 2 Qu Write a program that will take binary input from user and will also display it emodal small Rol bx, ) ose lool, ie ie 7 y|rmov 0,'o vt ab lor", You Typed = Ven gy ah) 2 Main Pyoc moy ax, Odata op pint Mou ds ay as XOR by, bx Ne mov ah, ] Ney ahi INPUT: ne Ah a i, Int alh CMP al, 13 2? Print SE END. exie SL lox, | MoV ahi Uch SUB al 4g mes é, bial Main Endp | P T Endl Hain END—+ mov cx )S& mov ahi4 mov dx, offset vi= ae - i ; ; b 5 wnte an assembly language code that will take Hexa input from user and will also display it. (go . * | vedel small nsext 2 q ar eon ot bhial . job et TMP In put . » JEN D-: vi db 10,13;"You TXPED:§ scode - Voc, Main mt ah Mev ax, Odaba mov cx, Y mov ds, ax Mov ah, 2 X b Print = ns mov olf, bh pmo chy SHR at, | bo mov ahi SHR ALT | Tnpubs HR AQ, | | et ah R Avy © MP ab 13 CMP lt 4 JE ENDL ye DispNumber add ds ¢ SHU bevel SMP dis CMP al, q? ispNumber' mov ah ch SLE Number dat Aue "|e Sub ah, € disp Wl lh po S6 ‘int’ alh Main Endlp SMe Inset RoL bx, End Num, RL box, | a | Sub al, ug Rol. ba, { Comments/Signature (Student & Teacher): 1 5 af ek30. LAB #9 Theory: Stack A stack is one-dimensional data structure. Items are added and removed fiom one, addin’ structure; that is, itis processed in a “last-in, first-out" manner. The most recent Ie is a stack of dishes; the k my stack is called the top of the stack. A familiar example is the last it the stack isthe top one, and it's the only one that can be removed easily. ‘\ program must set aside a block of memory to hold the stack. We have been doing declaring a stack segment For example: STACK 100H / Task 9.1: Programming Practice Qu Write an assembly language code that will input a string from user and will display itin reverse order on next line, Sample Execution: ‘ABCDEFGH mov dl, \3 HGFEDCBA ‘ ; ic emodel gmeall now A *Stack look » dota Ld: ° code fee a ° Mev ah,L Main Proc int alh mov ch,7 Loop LL } ie Mov ah ch mov ah)) int alh int ah Main End p mov ahiO End Mai push ax “uN Loop U4 mov ah,2 mov dl,\o i h Tats 21. signature (Student & Teacher):<31- | Q.1 Write an assembly language code that will display 10x10 boxes of asterisks (*) by sig procedures. , ' F) Moy real 7 '* prot: int alh (oop py ole pop a & Moan Py yet 3 P int 57k endp O eyo ax @date mov ds, ax nl prot OV ah,4F [f teh vb mov 6X10 mov Ax, 2 Call print stay Fink alh cad) nl yet , loop oulet ne end P ancl yairy , Gudea ovtes mov ab,Ych ant ath main GndP prindstac pre push CX ww ov CX/10 MOV ah, | Comments /Signature (Student & Teacher):i LAB #14, Theory: Decimal Vo Decimal Input and Output Procedures: Even though the computer represents everythin, input and output expressed in decimal tn this vo. Seaieit@t¥, its more convenient for the user to see Stction, we write procedures for handling decimal Task 11.1: Programming Practice Hint: Use Procedures of DECIN and DECOUT smodel smal) — | CUP al“? > stack looh SE minvs aba > code . Ale Main Proc PE plus call Dec} ehG REPEAT Ql Call Decout TAY S's mov ahi ch May ex, | [ine erp lus- an ty Decin Proc int ah push bx Repeat as push cx CNP alfa! Push Ax - : INGE Nor Begins > [OHP ALS? mov i “5% JSNLE Not _O pac At 2 AND Ax 000FH int ath push ay 5 mov ax, lo Xor x tbx Boe be XOR cx, cx [pop be PA bx,ax Moy ah ||-M- 2 Write assembly language code that will calculate LCM of two numbers and will ¢; a Sample Execution: ENTER FIRST NUMBER: 2 mov ax, @data WOV dasjax ENTER SECOND NUMBERS mov x lad ailah mov ay vi While_: meclel smal mov bx,v2 estack woh v XOR Ax dy s dada MUL bx div by ico Niv cx ree dx Pm VL dw us prey LeM 1 ax ae “ CALL X10 Duce ee 2 i oe INE while mov ah Ul of LCN dw 2 int ath Mov ahr -code Main fad Mev ete to Main Proc | iat alh Ruste ov ah 4 mov axl push Cx prints mov byx,v 2 op dx : ™ eee DD all, 4g mov aX,0 CMP Ax, 0 int alb ov : vnos oe sq Alpha —(fL&eP._ Pint div b ‘ Push Ax PAP oly iv bx Moy dtc! Pop cA mov bx dx pep bx vy ar, cx ev ah,d mo 1 Kut ath Pop ax CMP bx,0 Pop Ay RET JNE While _ Neq ax Pecopt endp mov HWCF 1a Ng\ana, End Mainas. A Wate assembly language code ‘hat Will calculate SCD of mode! Smath estack look ePala vi db “Ember Nanbey yo ab & Gen 28" Code Main Prog wmev ax, @dada MOV as, ns Moy Ax, 0 PF seb vA OV ah, 9 Of two numbers and b E Xene, Div by Push dya “40. Task 12.1: Programming Practice ‘Task L. Write a code that will add clements of an array and will display their sum, “Mocel smatl > stack lool A » WA dus 00,200) 390 400,600 600 700 code Main Proc mov ax, @daka mov dsjaq x Mov Si) Offset ary cx,T AxK,O moy mov ee Mov ax, Usi | ADD svi Loop LU Call Decout mov als Uch int ath Main Enel p Decev t Pree push ax push bx Push cx cmp ax,O mov US ‘wt al JG Alpha ay af Push Ax Print ~ ov dl pap ax ov ah, 2 JAPD OL,4g Int lh INT alh Pop ax leop print Neg ax por ax Aha: (Pep Xr Cx Cy pep lox Mov Bx lop Pep 9x While_s RET Yor Dx Dx Decovt Endp Div Bx End Main Push Dx INC Ch CMP ax,o SNE While, Mov ah, L Mov Al jo Mat al LoH — Fann 2c that will eleulte average of an ray and wil alo di odd srnolJ Push cx J oack \coh Push ds dota dd ax,66Sd wer AY 106 , 200,200 , 409 UP ax d code. vain Prog cov ax, @daba mov ds ,qQxr moy dt’) mov ah mov si, offsel oxy wet aie Mov CK Yy a an rp ax x Lis 6 * add ax {si | fella add si) > X0x cx cx loop uo Mov bx lo¢l Yor A whilee_+ ae Maer Axel mov bx, 7 e los n div bx ay bx call decout Posh chy gee! ah Yoh No CX mt nm 2th emp any Main End G NE whilee _ Recouk Proc . ov ah, 2 Push ayTask 3.Write an Assembly Language code to search a number in an Array. emodel small Leap Searchin sstack 00h mov dx offset 43 odata Mev ah, avy db 12,3,5,11,89,7, int a\h WOIET4 NS IMP Ende vi Ab “Entey Number $” : , [Num Pound V2 db 10,13, Number Found $ ‘ mov dx offset vey ba V3 Ab "0113; Number Not Faondg mov ah) 4 1D) valve dl n int ah * code End_: Main Pyoc mov ah, Uch mov ax ,@data int ath mov ds,ar Main Enel p MoV Ax joffset vb GrelEMalral- int alh mov ah,\ int ah Sub ab, ‘o? mov value, of mov si,offset ary mov cyx,\O mov al, valve Searchin - mov bors) CMP al, bd Ho hlam POO)-43- Task 41WRite an Assembly Language code o print umber of occu rmodel Smaff decast rstack \ooh ov. ah) Yeh, dota Mt ath count alu 0 Maing x dw \oo Recout Proc any dw ae ooh pan code Push cx Moin Py Ge Push dx Mov AX @ dada ™p ax, 0 mov als. qx SG Alphoy evs} ) Offset arr] push ax MOV ex ov Al, MoV ax, y Ynoy ah, li: int ath SOP Ox, TS} Ppop ax JE v2 ay Kdd si ,2 Shas leop L4 KoR CK Gy IMP ext “Mov bx 102) ecovl Endp Whe Nee. C Me count XR Bx Dy eka $i,2 DIV Bx bmp Ls eras ee.<4: | ye code to print minimum and maximum number in Array, Assignment # 3 Qu1.Write an Assembly Langu «model smatl Barge * + stack Jooh yoy LQ, Vsi] . -dlata + 7 mA ate avy db 10S 4, \1yX gmp camp * code p main endP Main Proc - End man: Mov ax @doto mov ds; &X& mov Si »of fset ary mov Cx, S mov bl, Tsil loop looptt add b8,48 mov Al, b mov al: 2 int ah smalls mov bafsi] Jyap ympare Comments/Signature (Student & Teacher):
You might also like
Assembly Lab Manual
PDF
100% (1)
Assembly Lab Manual
21 pages
Computer Networks Outline25Sep23
PDF
No ratings yet
Computer Networks Outline25Sep23
7 pages
MPMC Alp
PDF
No ratings yet
MPMC Alp
40 pages
CS632 Lecture 03
PDF
No ratings yet
CS632 Lecture 03
44 pages
Assembly Program's File
PDF
80% (5)
Assembly Program's File
30 pages
CS 2110 Homework 5 Intro To Assembly
PDF
No ratings yet
CS 2110 Homework 5 Intro To Assembly
15 pages
Instruction Set of 8086 Microprocessor
PDF
No ratings yet
Instruction Set of 8086 Microprocessor
91 pages
CS632 Lecture 04
PDF
No ratings yet
CS632 Lecture 04
42 pages
8086 Assembly Language Programming: Cutajar & Cutajar © 2012
PDF
No ratings yet
8086 Assembly Language Programming: Cutajar & Cutajar © 2012
64 pages
Lab Report
PDF
No ratings yet
Lab Report
30 pages
Mic Manual
PDF
No ratings yet
Mic Manual
33 pages
Lab 03
PDF
No ratings yet
Lab 03
14 pages
Embeded 5
PDF
No ratings yet
Embeded 5
28 pages
Coal Assignment1
PDF
No ratings yet
Coal Assignment1
22 pages
A2 Coal
PDF
No ratings yet
A2 Coal
14 pages
Lab Manual-Coal-Bsai
PDF
No ratings yet
Lab Manual-Coal-Bsai
86 pages
All Labs
PDF
No ratings yet
All Labs
21 pages
Coal 10
PDF
No ratings yet
Coal 10
14 pages
MIC Manual
PDF
No ratings yet
MIC Manual
47 pages
MPMC Lab
PDF
No ratings yet
MPMC Lab
29 pages
Lecture 3 Introduction To 8086 Assembly Language
PDF
No ratings yet
Lecture 3 Introduction To 8086 Assembly Language
51 pages
Coal Assignment 3 Name: Faizan Tariq Roll No: 22F-3858 Section: 3D
PDF
No ratings yet
Coal Assignment 3 Name: Faizan Tariq Roll No: 22F-3858 Section: 3D
5 pages
Assembler Practicas
PDF
100% (1)
Assembler Practicas
11 pages
2 Asm Workbook
PDF
No ratings yet
2 Asm Workbook
50 pages
8086 Instruction Set
PDF
100% (1)
8086 Instruction Set
92 pages
Shravanij
PDF
No ratings yet
Shravanij
46 pages
Lab Manual
PDF
No ratings yet
Lab Manual
45 pages
Lab 02
PDF
No ratings yet
Lab 02
7 pages
8086 Instruction Set
PDF
100% (1)
8086 Instruction Set
92 pages
MPMC LAB Manual R20-1
PDF
No ratings yet
MPMC LAB Manual R20-1
50 pages
8086 Instruction Set
PDF
No ratings yet
8086 Instruction Set
92 pages
Assembly Language
PDF
No ratings yet
Assembly Language
13 pages
COA ExperimentNo.1
PDF
No ratings yet
COA ExperimentNo.1
11 pages
Microprocessor Programming I
PDF
No ratings yet
Microprocessor Programming I
46 pages
LaboratoryNo2 Debug
PDF
No ratings yet
LaboratoryNo2 Debug
11 pages
Chap 4 e
PDF
No ratings yet
Chap 4 e
22 pages
Lab Manual For Assembly Language12
PDF
No ratings yet
Lab Manual For Assembly Language12
5 pages
Laboratory 4
PDF
No ratings yet
Laboratory 4
13 pages
Lab 2
PDF
No ratings yet
Lab 2
10 pages
Lab # 01 Introduction To Assembly and Assemble: Programming Languages
PDF
No ratings yet
Lab # 01 Introduction To Assembly and Assemble: Programming Languages
4 pages
Mp&i Course File - unit-II
PDF
No ratings yet
Mp&i Course File - unit-II
12 pages
Microprocessor Assignment
PDF
No ratings yet
Microprocessor Assignment
11 pages
Mid Report
PDF
No ratings yet
Mid Report
12 pages
Advanced Microprocessor & Microcontroller Lab: Masters of Technology
PDF
No ratings yet
Advanced Microprocessor & Microcontroller Lab: Masters of Technology
17 pages
The First-Half Review: 1.1 Local Labels
PDF
No ratings yet
The First-Half Review: 1.1 Local Labels
5 pages
MIC CHP 2
PDF
No ratings yet
MIC CHP 2
5 pages
Al-Rouman (Micro Lab3&4 D1 - )
PDF
No ratings yet
Al-Rouman (Micro Lab3&4 D1 - )
16 pages
Bad Smells in Code
PDF
No ratings yet
Bad Smells in Code
53 pages
GROUP
PDF
No ratings yet
GROUP
28 pages
Past Paper Assignment
PDF
No ratings yet
Past Paper Assignment
70 pages
MicroProcessor Code Examples Week
PDF
No ratings yet
MicroProcessor Code Examples Week
8 pages
Umaima Coal
PDF
No ratings yet
Umaima Coal
14 pages
Micrplab
PDF
No ratings yet
Micrplab
17 pages
MP Assignment1
PDF
No ratings yet
MP Assignment1
7 pages
Computer Architecture Lab
PDF
No ratings yet
Computer Architecture Lab
12 pages
Coal Assign 2 016
PDF
No ratings yet
Coal Assign 2 016
12 pages
Group No 3 (7 Person)
PDF
No ratings yet
Group No 3 (7 Person)
11 pages