Link list/file stamps/clusters Odds and ends remaining for test 2.

Slides:



Advertisements
Similar presentations
Welcome to Who Wants to be a Millionaire
Advertisements

$1 Million $500,000 $250,000 $125,000 $64,000 $32,000 $16,000 $8,000 $4,000 $2,000 $1,000 $500 $300 $200 $100 Welcome.
Name: Date: Read temperatures on a thermometer Independent / Some adult support / A lot of adult support
$1 Million $500,000 $250,000 $125,000 $64,000 $32,000 $16,000 $8,000 $4,000 $2,000 $1,000 $500 $300 $200 $100 Welcome.
Copyright © 2003 Pearson Education, Inc. Slide 1.
Win Big AddingSubtractEven/Odd Rounding Patterns Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Last Chance.
1 1  1 =.
1  1 =.
Year 6 mental test 15 second questions Numbers and number system Numbers and the number system, Measures and Shape.
Who Wants To Be A Millionaire?
Who Wants To Be A Millionaire?
I can interpret intervals on partially numbered scales and record readings accurately ? 15 ? 45 ? 25 ? 37 ? 53 ? 64 Each little mark.
£1 Million £500,000 £250,000 £125,000 £64,000 £32,000 £16,000 £8,000 £4,000 £2,000 £1,000 £500 £300 £200 £100 Welcome.
Welcome to Who Wants to be a Millionaire
$100 $200 $300 $400 $100 $200 $300 $400 $100 $200 $300 $400 $100 $200 $300 $400 $100 $200 $300 $400.
Machine-Level Programming III: Procedures Feb. 8, 2000 Topics IA32 stack Stack-based languages Stack frames Register saving conventions Creating pointers.
Progam.-(6)* Write a program to Display series of Leaner, Even and odd using by LOOP command and Direct Offset address. Design by : sir Masood.
Created by Susan Neal $100 Fractions Addition Fractions Subtraction Fractions Multiplication Fractions Division General $200 $300 $400 $500 $100 $200.
Before Between After.
Subtraction: Adding UP
Equal or Not. Equal or Not
Slippery Slope
Making Numbers Two-digit numbers Three-digit numbers Click on the HOME button to return to this page at any time.
Look at these sequences. What is happening? 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 10, 20, 30, 40, 50, 60, 70, 80, 90, , 200, 300, 400, 500, 600, 700, 800,
Number bonds to 10,
Let’s take a 15 minute break Please be back on time.
Nodo Gastronómico en la Provincia de Elqui
Partial Products. Category 1 1 x 3-digit problems.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Pointers and Linked Lists.
Assembly Language for x86 Processors 6th Edition Chapter 5: Procedures (c) Pearson Education, All rights reserved. You may modify and copy this slide.
C Programming and Assembly Language Janakiraman V – NITK Surathkal 2 nd August 2014.
Assembly Language for Intel-Based Computers Chapter 8: Advanced Procedures Kip R. Irvine.
Assembly Language for Intel-Based Computers Chapter 5: Procedures Kip R. Irvine.
Runtime Stack Managed by the CPU, using two registers
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 12: High-Level Language Interface (c) Pearson Education, All rights reserved.
Accessing parameters from the stack and calling functions.
CS2422 Assembly Language & System Programming October 26, 2006.
CS2422 Assembly Language and System Programming Procedures Department of Computer Science National Tsing Hua University.
CS2422 Assembly Language & System Programming October 24, 2006.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 12: High-Level Language Interface (c) Pearson Education, All rights reserved. You.
INVOKE Directive The INVOKE directive is a powerful replacement for Intel’s CALL instruction that lets you pass multiple arguments Syntax: INVOKE procedureName.
Web siteWeb site ExamplesExamples Irvine, Kip R. Assembly Language for Intel-Based Computers, Defining and Using Procedures Creating Procedures.
CS2422 Assembly Language and System Programming High-Level Language Interface Department of Computer Science National Tsing Hua University.
Assembly Language for x86 Processors 6th Edition Chapter 13: High-Level Language Interface (c) Pearson Education, All rights reserved. You may modify.
Assembly Language for Intel-Based Computers, 6 th Edition Chapter 8: Advanced Procedures (c) Pearson Education, All rights reserved. You may.
Lecture 18 Structures and Macros Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
Assembly Language for Intel-Based Computers, 6th Edition Chapter 5: Procedures (c) Pearson Education, All rights reserved. You may modify and copy.
High-Level Language Interface Computer Organization and Assembly Languages Yung-Yu Chuang 2005/12/15 with slides by Kip Irvine.
Chapter 12: High-Level Language Interface. 2 Why Link ASM and HLL Programs? Use high-level language for overall project development Relieves programmer.
Sahar Mosleh California State University San MarcosPage 1 Nested Procedure calls and Flowcharts.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
Computer Organization and Assembly Languages Yung-Yu Chuang 2006/11/13
1 The Stack and Procedures Chapter 5. 2 A Process in Virtual Memory  This is how a process is placed into its virtual addressable space  The code is.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 5: Procedures Lecture 19: Procedures Procedure’s parameters (c) Pearson Education, 2002.
Procedure Computer Organization and Assembly Languages Yung-Yu Chuang 2005/10/27 with slides by Kip Irvine.
CSC 221 Computer Organization and Assembly Language Lecture 16: Procedures.
CSC 221 Computer Organization and Assembly Language Lecture 20: Conditional and Block Structures.
Assembly Language for Intel-Based Computers, 4 th Edition Lecture 22: Conditional Loops (c) Pearson Education, All rights reserved. You may modify.
Assembly Language Addressing Modes. Introduction CISC processors usually supports more addressing modes than RISC processors. –RISC processors use the.
Lecture 15 Advanced Procedures Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
Recitation 3: Procedures and the Stack
Assembly IA-32.
Assembly Language Lab (4).
Computer Architecture and Assembly Language
Assembly Language for Intel-Based Computers, 4th Edition
Miscellaneous Topics.
X86 Assembly Review.
Assembly Language for Intel-Based Computers, 4th Edition
More on operators and procedures in the Linked
Presentation transcript:

Link list/file stamps/clusters Odds and ends remaining for test 2

Linklist output C:\Masm615>list

Linked list part1 ; This program shows how the STRUC directive ; and the REPT directive can be combined to ; create a linked list at assembly time. INCLUDE Irvine32.inc ListNode STRUCT NodeData DWORD ? NextPtr DWORD ? ListNode ENDS TotalNodeCount = 15 NULL = 0 Counter = 0.data LinkedList LABEL PTR ListNode REPT TotalNodeCount Counter = Counter + 1 ListNode ENDM ListNode ; tail node

Linked list continued.code main PROC mov esi,OFFSET LinkedList ; Display the integers in the NodeData members. NextNode: ; Check for the tail node. mov eax,(ListNode PTR [esi]).NextPtr cmp eax,NULL je quit ; Display the node data. mov eax,(ListNode PTR [esi]).NodeData call WriteDec call Crlf ; Get pointer to next node. mov esi,(ListNode PTR [esi]).NextPtr jmp NextNode quit: exit main ENDP END main

Linklist2 a linklist on the stack C:\Masm615>linklist2 enter numbers to quit 34 enter numbers to quit 56 enter numbers to quit 333 enter numbers to quit 12 enter numbers to quit 90 enter numbers to quit 609 enter numbers to quit 45 enter numbers to quit 32 enter numbers to quit 665 enter numbers to quit 435 enter numbers to quit 354 enter numbers to quit 09 enter numbers to quit 54 enter numbers to quit C:\Masm615>

Linklist2…build arbitrary size list (up to stack allocation) ListNode STRUCT NodeData DWORD ? NextPtr DWORD ? ListNode ENDS TotalNodeCount = 15;;;not used NULL = 0 Counter = 0.data nullval dword 0 prompt byte "enter numbers to quit",0 ;;;;LinkedList LABEL PTR ListNode ListNode ; tail node…not used.code

Linklist2 main main PROC push nullval push nullval;;;this is the tail ptr mov esi,esp;;;current node address more: mov edx,offset prompt call writestring call crlf call readint;;;;;;here is where we get data cmp eax,999 je doneInput mov ebp,esi push ebp ;;;this is the next node ptr push eax;;;this is the data mov esi,esp;;;now this is the address of current node jmp more doneInput:

continued NextNode: ; Check for the tail node. mov eax,(ListNode PTR [esi]).NextPtr cmp eax,NULL je quit ; Display the node data. mov eax,(ListNode PTR [esi]).NodeData call WriteDec call Crlf ; Get pointer to next node. mov esi,(ListNode PTR [esi]).NextPtr jmp NextNode quit: exit main ENDP END main

Date stamp year month day Year = and is added to 1980 Month=1..12 Day=1..31

Time stamp 15 0 hoursminutes seconds Hour=0..23 Minute=0..59 Seconds=

Cluster chain example- just links are shown eoc File starting cluster=1, filesize=7

Cluster chain example#2- just links are shown eoc File starts in cluster 5, size5

Arraysum recusive include irvine32.inc.data array dword 100, 200, 400, 300,700,900,800,500,600.code main proc mov esi,lengthof array dec esi shl esi,2;esi is last subscript mov eax,esi call writedec call crlf xor eax,eax call arraysum call writeDec main endp

continued arraysum proc call writedec call crlf cmp esi,0 jl L2 add eax,dword ptr array[esi] sub esi,4 call arraysum L2:ret arraysum endp end main

output

Proto example from text: arraysum include irvine32.inc arraysum PROTO, parray: PTR DWORD,sz:DWORD.data array dword 10, 20, 30,40,60,50,70,80 message byte "here is the sum",0.code main proc mov edx,offset message call writeString call crlf invoke arraysum, ADDR array,lengthof array call writedec call crlf exit main endp

continued arraysum proc USES esi ecx,pArray:ptr Dword,sz:Dword mov ecx,sz xor eax,eax mov esi,pArray top: add eax,[esi] add esi,4 loop top ret arraysum endp end main

output here is the sum 360 Press any key to continue...

Array search recursive (using registers) include irvine32.inc.data array dword 100, 200, 400, 300,700,900,800,500,600.code main proc mov esi,lengthof array dec esi shl esi,2;esi is last subscript mov eax,esi call writedec call crlf mov eax,501;;;wont find it call search mov eax,ebx call writeInt ;;will write -1 for not found main endp

Recursive search proc search proc mov ebx,-1 cmp esi,0 jl L2 cmp eax,dword ptr array[esi] jnz skip mov ebx,esi shr ebx,2 jmp l2 skip: sub esi,4 call search L2:ret search endp end main

Writes last subscript then found value First run…look for Second run look for found in position 7