Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Review #2 1. For each of the following type definitions, write declarations of a

ID: 3596843 • Letter: R

Question

Review #2 1. For each of the following type definitions, write declarations of an object g of a. data v a = This a l That a type w = [ (V Float, Integer, Bool)] type w = [a] -> (a-> b-> b)-> b-> b type w = Eq a => a-> ((a, a) -> Bool) b. C. 2. Write the following haskell functions in a single clause. a. w (2, d, q) = q ++ [d] w(-,-, q) = q b. kj (5 : b) = j : (k j b) k-' (a : b) = a : (k a b) 3. Write a function diffx of type a Integer, that always returns 3 if dynamic scoping is used to evaluate it, and always returns 6 if static scoping is used to evaluate it.

Explanation / Answer

sal ax,cl ; convert from KB to paragraphs (*64)

mov bx,es ; get psp

add bx,ax ; new top of memory

mov si,2 ; point to top of memory in psp

mov ax,[si] ; get current top of memory

cmp ax,bx ; is new setting larger?

jae p055 ; no

mov dx,offset msg2 ; yes - print msg

jmp p065

p055: mov [si],bx ; save new top of memory

jmp p080

p060: mov dx,offset msg1 ; print the message

p065: add dx,100h ; fudge for the psp

mov ah,9

int 21h

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote