Skip to content

Instantly share code, notes, and snippets.

-- ariovaldo capuano neto (acn2)
-- (questao 1)
meio :: String -> Int -> Int -> String
meio _ _ 0 = ""
meio "" _ _ = ""
meio str x y
| (x < 0) || (y < 0) = ""
| (length str) >= x = str!!(x-1) : (meio (tail str) x (y-1))
# para consulta:
# var i -> -36(sp)
# var j -> -40(sp)
# var A[] -> (-32 a -16)(sp)
#.globl _start
_start:
# alocar espaço para array na stack
addi sp, sp, 40
# adicionar cada um dos elementos {5, 1, 4, 2, 3}
main:
addi a0, zero, 7 # function argument (7)
jal ra, fact
jalr x0, x1, 0
fact:
addi sp, sp, -16
sw ra, 8(sp)
sw a0, 0(sp)
addi t0, a0, -1
@aricneto
aricneto / cloudSettings
Last active March 19, 2022 20:19
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-04-06T19:58:12.777Z","extensionVersion":"v2.9.0"}
@aricneto
aricneto / designer.html
Last active August 29, 2015 14:21
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>