青春时代是一个短暂的美梦,当你醒来时,它早已消失得无影无踪了。
 
昨日:篇  今日:篇   总帖:篇   会员:
今日:0
文章:0
今日:0
文章:5
今日:0
文章:1
今日:0
文章:5
今日:0    总帖:43
admin
63
转自:听雨轩有声电台  原文地址:http://mp.weixin.qq.com/s/TifDO-kE-yhxT3W9wdhCcg “即使是生活在阴沟,我们也有仰望星空的权利。”——阿米尔·汗     他的“仰望星空”,不是文艺青年的风花雪月。他用近乎残酷的方式,剖开印度的伤口,向国人和全世界展示社会的肮脏和弊病。01▼我喜欢一次只做一部电影为这一部倾尽所有一开始,阿米尔·汗并不喜欢电影,即便他出生在电影世家,且年幼成名。阿米尔·汗少年时其实极有运动天赋。那时的他热爱网球,不仅成为马哈拉施特拉邦的网球冠军,还与偶像费德勒打过友谊赛,梦想成为一枚网球小王子。但属于你的迟早会找上门。大学期间,阿米尔友情出演了一位朋友拍摄的无声小短片。大概是冥冥中的召唤,阿米尔说:“拍那部短片让我知道了自己属于那里”。于是毅然从学校辍学,一心投入演艺事业。然而,他的演艺之路走得却并不顺利。1988年,凭借电影《冷暖人间》,阿米尔汗一炮而红,并获得印度最高电影奖Filmfare的最佳新人奖。但接下来签下的九部电影都成绩寥寥。业界人士称他“只有一部电影的奇迹”,预测他将一蹶不振。阿米尔·汗开始在痛苦中自我反省,自我定位,要求自己每年作品绝不超过两部。“我喜欢一次只做一部电影,为这一部倾尽所有。”1992年开始,阿米尔·汗状态开始慢慢恢复。他对演戏的虔诚和认真甚至令人害怕。他曾经把四年时间花在一部戏上,就是《抗暴英雄》。兼为主演和制片人,他不停跑图书馆翻看历史资料,花了一年时间留起长发和八字胡。阿米尔·汗将自己视为“生产工具”,一丝不苟地表现电影的各种细节。和现在的演员喜欢用化妆不同,他电影中的每个样子,都是他本人的真实状态。在拍摄《摔跤吧!爸爸》的时候,先疯狂增肥60斤,再瘦回来,从19岁到51岁,他完美表现出了每一个阶段的体态变化。导演曾经劝他不要那么拼,化妆就好了。但他坚持成为一个真正的胖子:“只有成为胖子,我才能体会到胖子的感受。” 阿米尔·汗习惯在拍电影的时候写下“遗书”。甚至经常担心:如果我死了怎么办?如果我严重受伤怎么办?在每一场拍摄完成后,他会留给工作人员一个字条,上面写着万一他意外死亡,电影接下去的制作计划。在《摔跤吧!爸爸》拍摄期间,他甚至想好了四五个备选演员的名单。他有很好的电影嗅觉和商业眼光,拍出的电影总是叫好又叫座。接连刷新印度电影四个十亿级票房纪录。《摔跤吧,爸爸!》放映的时候,影片结束时,很多影院的观众全体起立,鼓掌致敬。但他却说自己拍电影之前从不想票房,也不会想有多少人去看。“故事是最重要的,如果我要拍一部电影,首先我一定要爱上这个故事,这样我才会有动力。” 也正是因为珍视初心,现如今阿米尔·汗几乎是与高质量电影画上了等号,有网友说:“阿米尔·汗的眼睛里有全世界,有他在,电影质量就有保证。”02▼我无心激化矛盾只为能改变这个时代红了之后的阿米尔·汗开始反思:“教师给社会提供教育,医生提供医疗,艺人能够给这个社会做些什么呢?”他决定用电影来改变世界。他好像带着天然的使命感,这种使命感,让他的电影充满力量。这一次,阿米尔·汗进入大众的视野,是因为《神秘巨星》。这部对准了妇女处境和妇女权益的电影,灵感来自于2012年阿米尔·汗系列节目《真相访谈》。在节目中,阿米尔·汗听到了一个女儿支持妈妈反抗的故事,直接激发了他拍摄《神秘巨星》的想法。在印度,妇女地位低下,每6小时就有一位妇女死于家暴。但印度社会却认为,丈夫殴打妻子,合情合理。但阿米尔·汗决心唤醒这些沉睡的人。从《摔跤吧,爸爸!》到《神秘巨星》,阿尔米·汗鼓励女性去做梦,去争取自己的权利。通过自己的力量,推动社会发生变化,用电影里的故事去影响别人,是阿米尔·汗的梦想。《摔跤吧,爸爸》《神秘巨星》中,他鼓励女性改变自身处境,主张自我权利,追求梦想:“你的胜利不只属于你,还属于千千万万被误解被歧视的女孩。”《三傻大闹宝莱坞》里,他向传统的应试教育发起了尖锐的挑战,告诉每一个人“死记硬背也许能让你通过大学4年,但会毁掉你接下来的40年”。通过《我滴个神啊》,他将宗教议题摆在了大屏幕,告诉大家“爱你,是要给你自由。”宗教也是。这部电影甚至冒犯了印度的政治团体,有印度教徒在公开场合焚烧海报,右翼人士抵制影片上映。阿米尔·汗一次又一次将印度的社会问题展现在大家面前。他明白,身为明星,担负着比别人更重的社会责任。一个人的力量是微小的,阿米尔汗却坚定不移。他深知自己的行为的意义:“我无心激化矛盾,只为能改变这个时代。无论是谁心中,只要有星星之火必将成燎原之势。”03▼没必要为自己祖国被放在聚光灯下而羞耻应该羞耻的是我们的国家在哪一方面有欠缺2012年,阿米尔·汗登上《时代周刊》亚洲版封面。评论写道:“他直面印度的社会弊病,打破了宝莱坞的固有模式,一个演员能够改变一个国家吗?”答案是肯定的。为了《真相访谈》,阿米尔·汗带领团队走访全国,儿童性侵、杀女婴、堕胎、包办婚姻、性别歧视、家庭暴力、种姓制度……这些敏感话题全都成为《真相访谈》的主题。当时很多身边的朋友都劝他:“你做这些对自己根本没好处,还会引起民众反感,降低你的人气。”阿米尔·汗在节目中自白:“我想讨论一些关系印度民生的话题,不责难任何人,不中伤任何人,也不制约任何人。人人都说,伤害我们的人近在咫尺,或许我们都有责任。”但节目一经播出,还是差点遭到印度当局的封禁,然而,仍然有超过6亿人观看了他的节目,他的每一期节目,都引起强烈社会反响和舆论关注,有人把这档节目叫做“印度的眼泪”。 在采访中,阿米尔·汗说:“我不知道这会不会影响到我的从影生涯,但是生而为人,我确实更关心我祖国的现状以及我同胞们的处境。这是一种选择,不是我们的义务,但是如果我们想这样,是可以做到的。”有人评价,阿米尔·汗是印度的“国宝级演员”。而在很多人的心中,阿米尔汗,早已不仅是一位演员。他的使命感和爱国精神,注定使他成为被这个时代铭记的人物。 2013年,阿米尔又作为“100位年度人物”再次登上《时代》封面,列入的并不是“艺术家”类别,而是定位为“先驱者”。这个头衔实至名归。因为他讲过这样的话:“拍摄电影不是用来迎合谁的。其实当你拍摄了一部对自己国家有一定批判意义的电影时,这对国家就有着至关重要的意义。所以批判自己和自己的国家是我们进步的第一步。没必要为自己祖国被放在聚光灯下而羞耻,应该羞耻的是我们的国家在哪一方面有欠缺。” 因为他,我们才知道,除了柴米油烟的生活之外,头顶还有一片浩瀚的星空;在个人的悲喜之外,人生还有更崇高的价值和意义需要守护。因为他,我们才知道,在这个时代,是多么需要阿米尔·汗这样的人。致敬阿米尔·汗。晚安文|崔老板
0 0 18天前
admin
133
    让先来回顾过去,早期的3d(或伪3d)游戏都挺小的,无论是诸如《德军总部3D》的早期PC游戏,还是nes、N64、各类街机、md、ps1、早期java手机、塞班手机、mtk手机……它们的容量很少,小到mb甚至kb计算。    但是!这些游戏实在太粗糙了,难道就没有画质比较好一点的???    有,也许目前已知的就这么一个。    这游戏叫《kkrieger》,只有96kb,光影效果非常不错!    那么,是否意味着一个低容量的大型3D游戏是可行的呢,答案是不行的,    原因有以下:    1.游戏过场视频:一般来说,视频占的容量相对很大,所以,不要用视频了。用即时演算代替!     2.游戏背景音乐:如果背景音乐是纯音乐的话,那么用mp3或ogg等格式就是浪费!这其中有多少重复的音?联想起midi格式的和弦乐。再联想起64kb程序动画的那一直重复的背景音,用这种方式缩小体积理论上没问题。     3.游戏贴图:目前3d模型用的贴图还是位图,能不能改用矢量图呢?用复杂的算法做出贴图。估计又能省一些容量。    4.游戏人物语音:     目前的游戏人物语音大多都是请人配音的,能否改用计算机演算呢?联想起以前xp系统自带的microsoft SAM语音系统。再看看现在安卓手机的原生或第三方TTS,也许又能减少大量体积,不过现有的技术不够完善,我想,也许还要加上语气、声调、音色等各种变化。     综合以上的看,实际上是不可行的,那么为什么kkrieger可以实现呢?这里引用知乎上的回答:“kkrieger makes extensive use of procedural generation methods. Textures are stored via their creation history instead of a per-pixel basis, thus only requiring the history data and the generator code to be compiled into the executable, producing a relatively small file size. Meshes are created from basic solids such as boxes and cylinders, which are then deformed to achieve the desired shape - essentially a special way of box modeling. These two generation processes account for the extensive loading time of the game — all assets of the gameplay are reproduced during the loading phase.”--WikipediaIn computing, procedural generation is a method of creating data algorithmically as opposed to manually. In computer graphics it is commonly used for creating textures. In video games it is used for creating items, quests, and level geometry. Advantages of procedural generation include smaller file sizes, larger amounts of content, and randomness for less predictable gameplay.通过储存生成器和创造步骤来使复杂的纹理变成了非常省地省空间的执行代码。而大部分形状则都是通过圆筒和立方体的扭曲变形,毕竟保存一个建模还是省空间。而运行之后,游戏本身便会开始执行生成步骤,将所有的纹理建模在内存中生成出来。所以为什么打开游戏之后会有漫长的读取时间,以及不科学的内存占用量。简单来讲,就是并非通过保存成品,而是通过保存生成器和生成步骤,让程序在启动之后按照步骤重新将成品生成出来。当然啦,这种压缩方式有相当大的局限性。首先他实际上并不是“压缩”,他实际上是属于再创造了...有一点像你自己买了个需要自己组装的书桌...不对,这个其实连书桌的木板都没给你,实际上就给了你一个如何砍树做板材拼装的手册……而一般的压缩,则是把书桌研究一下,然后拆成一块一块的,最后配一本组装说明书发送给你。过程生成的缺陷就显而易见了,他的内容从一开始就要决定是要通过特定的编辑器来创造并记录过程。所以如果采用的是导入的素材(比如说现实世界中的树啊布啊的纹理,人脸动物皮肤什么的),那么很明显是无法进行“压缩”。而普通压缩方式则不一样,因为他实际上是从已存在的文件入手,用词典(说明书)的方式来对重复,空白部分进行索引以达到节省空间的方式。通过上面的文字,我们不难看出,由于kkrieger实际上只是一个保存生成器和生成步骤的文件,因此才可以实现这么小的容量,所以如果还在对这个问题抱有想法的,可以暂时放弃了。。。最后放上那个kkrieger给大家,看画面至少在05年还是不错的,Win7下可直接运行,Win10下运行需要设置兼容性为Win7与以管理员身份运行文件下载:点击此下载kkrieger文中部分内容引用自:https://www.zhihu.com/question/38247446
1 0 63天前
admin
123
原文地址:点击访问差评君今天在去公司的路上接到了一个健身房的推销电话,我假装表现出很感兴趣的样子聊了一会儿,以家离太远为理由拒绝了。本来我觉得没多大事儿,推销电话差友们肯定也经常接到。不过后来一拍脑袋想了想不太对,我昨天刚刚在手机上查过健身房,啥也没留下,这第二天能有人直接打我的电话号码推销健身房会员?要不是虽然我每年都心血来潮想健身,但最终只是装模做样地搜索一下就放弃的话,那这就是一次精准的营销啊!差评君对这个现象背后的手段很好奇,找到了老朋友振宇兄(公众号:一本黑,ID:darkinsider)一起探究了一下原理,结果又双叒叕冒出来个黑产。振宇问了黑客老师傅有什么看法,老师傅表示一般就是企业或机构为了做 “ 精准营销 ” 非法抓取了用户的手机号,上 QQ 一搜就搜到了不少提供这种服务的群。振宇兄假装要买服务,和群主套上了话,让对方把价格,服务细节发来。用那边的话来说,他们可以抓到网站访客的信息,其中包括了 QQ,手机号码,所在地和兴趣等等,相当齐全。对方介绍服务的 Word 文件至于这个黑色产业有多成熟,看看下面这个图。。。群主说,他们会给购买产品的客户提供一个独立的后台,在后台里可以很清楚的看到所有抓取来的信息。差评君管这叫 “ 技术变现 ”怎么抓取呢?在指定网页或者 APP 里嵌一段代码。为了了解他们具体是怎么做的,黑客老师傅祭出了 “ 奥义·计算机基础知识 ”。老师傅分析了一下对方嵌入过代码的某网站,果然发现了网站主页有些问题,然后还原了网址,找到了这个黑产平台的访客统计系统。但是光发现系统没用啊,不进去哪能看到什么重要的东西,于是老师傅下定了决心祭出了 “ 进阶奥义·计算机中等知识 ”,通过一个常见的漏洞拿到了一个 “ 旗舰版 ” 用户账号。用户的手机号,IP 搜索词和上网方式都暴露在后台里了(这一看就是留学中介的目标用户)老师傅说,这种情况一般都是多渠道合作的结果,比如这些黑产商和手机浏览器合作,浏览器浏览指定网页的时候就会抓取手机号上报,不过一般这么做的都是野鸡浏览器,主流的大厂浏览器是不屑于去做的。还有野鸡浏览器???差评君抢来了一个小伙伴的国产手机,打开应用市场,随便一搜,果然特么有的是人去做。。。懒得请人设计图标,你也别整一模一样的啊,太不用心了吧喂不光浏览器,和运营商合作也可以抓取手机号。后来老师傅发来了一段网页获取用户手机号的代码例子。代码中的 “ x-up-calling-line-id ” 字段后面就是手机号码上面的代码是通过抓取 HTTP 请求里的信息来发现手机号的,不过现在随着系统升级和政策改变等原因,请求里不会含有手机号,没那么简单了。。。但是魔高一丈,黑产商会通过扫描运营商漏洞来获取数据端口。或者更可怕的情况是,有内鬼为了赚点私房钱给他们开放了后端接口,想想看我们看到的黑产这么发达,这种暗地勾结的情况可能才是比较普遍的,因为涉及了更多人的利益才会保护得这么好。说实话,运营商的利益点也不少,比如说下图这种劫持广告很多网站或者 APP 运营商会给黑产商提供服务,让他们嵌入恶意代码来偷用户的信息,而这些信息购买者不一定是最后一级消费者,用户信息可能会被贩卖好几次,好几层的供求关系算下来,妥妥儿的一个黑色产业链!用户信息被获取后,他们会处理数据并且分析用户,然后电话推销或者回访,做到精确营销。更可怕的是,有的人搞搞营销也就算了,毕竟还是做生意,但是指不定倒卖几手之后你的信息会跑到骗子手里。有的骗子通过搭建伪基站,冒用别的号码发诈骗短信(例如伪造银行信息)。伪基站的范围有限制,有的骗子搭在车上移动作案,这排场是不是有点像 《 窃听风云 》有的钓鱼网站里还会藏木马,这种木马会拦截银行发给你的短信,转发到骗子手上,这样一来,别人可以收到你的验证码登你的网银,替你把本来要上交给马爸爸的钱保管起来。。。老师傅说着,就拿出了手机绑了张银行卡,接着装了个木马,然后演示了一遍转账。果然转账记录什么的都收不到了,转到了老师傅的另一台设备里。也许有的人说我上网习惯好,不会上钓鱼网站的,但是有的野鸡手机维修店在干活儿的时候不太老实,会私自拷一份手机里的信息(比如通讯录,照片,账号),然后还会发展愿意购买信息的黑商,是不是防不胜防???有的人可能会多长个心眼,送修之前恢复出厂设置,但是碰到技术深厚的老司机,仍然有办法还原信息。我想这位老师身体力行地教育过大家了,不要小瞧搞技术的人。。。差评君还记得以前接到过很多失败的推销电话,因为我根本没这个需求,如今这些人也知道通过技术节约成本了,可惜选择了违法的方式,和倒卖盗取信息的黑产商合作。现在这个互联网时代,人在网络上存的信息越来越多了,暴露以后的后果也会越来越严重。现在,差评君和振宇兄一起通过这篇文章告诉你,你的信息值不少钱,这些钱能够扶起一条产业链,既然利益方一多,那么他们就有能力去提高技术手段,可以说防不胜防了。。。对于这种现象,差评君只想说平时上网一定要注意一些,小心钓鱼。对于黑产商,我也知道你们可能上有老下有小需要钱来打点生活,但是挣到这门钱的技术你用了手不觉得脏吗?这钱花着心不觉得愧吗?“知道现在推销这么精准,哪天收到什么增加持久力的推销广告,怕是心里得有点数了。。。
1 0 66天前
admin
258
HTTP状态码(HTTP Status Code)是用以表示网页服务器HTTP响应状态的3位数字代码。我们可以通过查看HTTP状态码来判断服务器状态,常见的有404 、502等;但是其他不是很常见的状态码都代表什么状态呢?下面有两张有趣的图片,让你瞬间都能理解了。301—永久移动。被请求的资源已被永久移动位置;302—请求的资源现在临时从不同的 URI 响应请求;305—使用代理。被请求的资源必须通过指定的代理才能被访问;307—临时跳转。被请求的资源在临时从不同的URL响应请求;400—错误请求;402—需要付款。该状态码是为了将来可能的需求而预留的,用于一些数字货币或者是微支付;403—禁止访问。服务器已经理解请求,但是拒绝执行它;404—找不到对象。请求失败,资源不存在;406—不可接受的。请求的资源的内容特性无法满足请求头中的条件,因而无法生成响应实体;408—请求超时;409—冲突。由于和被请求的资源的当前状态之间存在冲突,请求无法完成;410—遗失的。被请求的资源在服务器上已经不再可用,而且没有任何已知的转发地址;413—响应实体太大。服务器拒绝处理当前请求,请求超过服务器所能处理和允许的最大值。417—期望失败。在请求头 Expect 中指定的预期内容无法被服务器满足;418—我是一个茶壶。超文本咖啡罐控制协议,但是并没有被实际的HTTP服务器实现;420—方法失效。422—不可处理的实体。请求格式正确,但是由于含有语义错误,无法响应;500—服务器内部错误。服务器遇到了一个未曾预料的状况,导致了它无法完成对请求的处理;
2 0 131天前
admin
293
原文链接:https://mp.weixin.qq.com/s/jS85V6JtQvXnMXmek4K7GQ别拦我,我要去换微信头像了!微信头像重要吗?非常重要!在微信里,头像是我们判断一个人的首要标准,平时大伙肯定也都是靠头像认人的,万一某天换了下面这些头像,可能再也没有人找了!谁试谁知道!亲测,自从我换了这个头像以后再也没人来找我寂寞的夜,无人扰23333……后来,我换了个这个然后改名叫文件传输助手每天我都感觉业务繁忙!!!接着我又将QQ头像换成下面这个名字换成了“我的电脑”然后每天都会收到各种奇奇怪怪的文件当然还有的老友想把我拉黑2333……04为了和长辈们亲切些我又换了下面这些头像换了头像后平时不联系的叔叔阿姨都主动找我聊天了、某天在楼下看到一豪车偷偷去合了个影然后做成头像只是随手发了一句话还没有图竟然点赞无数简直受宠若惊!冥冥之中,头像为我开拓了一条撩妹道路一个月前我把微信头像换成了这个我的朋友们总以为加了卖猪饲料的微商.....摔!朋友们,就在刚刚我被踢出班群了……虽然我从没说过话07这里还有个隐身专用头像如果对方没设置聊天背景你基本上就隐形了不信你看↓不想被打扰的以下头像请查收09透露出满满的单身狗气息的微信头像不同状态,换不同头像装完就跑,感觉特别爽
27 0 134天前
admin
215
转载自:http://mp.weixin.qq.com/s/9GN0cxATX56GY8iss8HE3A作者 | 小九来源 | 每日七言(ID:mrqy88)================================================================离家的路有千万条外面的世界复杂又精彩可在家的爸妈心里只有一个期盼等你早日回家团圆中秋前夕,71岁的山西老两口抓紧推石磨准备辣椒酱,盘算着给六个孩子回家返程带上。没想到,一连接到几个电话,得知儿女都回不来,大爷忍不住哭了:“哪怕回来一个呢。”我们总以为,多挣点钱,有能力给爸妈买点好的是尽孝。可爸妈最期盼的,却是儿女能常回家看看,一起吃顿团圆饭。爸妈准备了一桌好菜,你夸一句好吃,他们就会喜笑颜开;饭后聊聊工作和生活,再琐碎的事儿,他们都听得津津有味。作为这个世界上最疼你、最关心你的人,他们不图你的回报,却始终处处为你着想。来时欣喜,走时伤感,再次离家时,总是不忘让你带上家乡的味道。塞得满满当当的行李箱里,都是爸妈沉甸甸的牵挂和爱。 01 南京禄口国际机场一位大叔行李箱超重30斤里面装的是母亲亲手做的煎饼和咸菜▼每一只临走的行囊都装着沉甸甸的亲情每一个游子的心里都有着暖融融的不舍 02 早上回无锡妈妈说给你煮两个鸡蛋带着我说可以啊结果煮了17个让我带着@Leo—JI▼父母能给你的不一定是全世界最好的但一定是竭尽全力给了你全部还生怕不够 03 省吃俭用一年全攒给儿女了@朱小桃happy▼只要和孩子有关哪怕一口吃的都是父母心目中的大事 04 随口抱怨了一句在外地吃不到口味正宗的火锅妈妈就在我行李箱里塞了好几袋火锅调料@中书护法▼不管走多远都别忘了家乡的味道不管走多久都别忽视爸妈的牵挂 05 我妈觉得外地消费高能省一点是一点给我装了很多吃的还塞了一把衣架@特蕾莎的浅笑▼离家之后才明白之前的岁月静好都是父母在替你负重前行 06 奶奶给我带的饺子不会写字的她画了图让我区分馅料@simple-小璐▼如果一个人真的爱你一定会想尽办法,竭尽所能 07 和老公开了一辆越野车回家回来的时候其余的座位和后备箱全部塞得严严实实@陈帅哥的鸡宝宝乖乖▼在这个世界上没有人比爸妈更爱你 08  爸妈非要给我带的土鸡蛋用米小心翼翼地保护好坐地铁的时候摔了几个心疼得要死不过没有扔,都打出来准备全部吃掉@圆圆嘀我▼无论你在哪儿背后都有父母默默的关心 09 我妈一个夏天照的节龟(知了的幼虫)冻在冰箱里临走前一天连夜炒熟让我在火车上吃@老乡开门我们真的是八路▼分明已经立业成家父母却永远把你宠成孩子 10 爷爷给拿了满满一行李箱土鸡蛋和咸蛋怕区分不开还做了标注@臭屁篓的小兽兽▼从来不说“我爱你”却一直用行动爱着你 11 回家一趟带回来的东西能装满冰箱@一层一层一层剥开你的皮▼可怜天下父母心心甘情愿地付出却从来没有想过回报 12 妈妈提前两个月给我做腊肉还装了快60斤自家种的大米满满的都是爱@泡泡蛮可▼衣裳再添几件饭菜多吃几口儿行千里母担忧 13 我妈给我装的葡萄干家里种的葡萄一滴农药没喷过不加催干剂,自然风干吃起来特别甜,特别放心@我和燕子的日常▼爸妈不求别的只要你健康快乐你的小幸福就是他们的大幸福 14 我爸偷塞给我的钱@请call我刘大菲▼“多吃点好的,多吃点菜别委屈自己没钱了跟爸妈说” 15 别人送给奶奶的嘉顿饼干她没见过,觉得很珍贵藏了快一年舍不得吃等着我回去给我其实饼干都过期了怕她心疼,我还是带着了@喵安安_▼他们比想象中更爱你 16 临走之前爸妈给我塞了一大袋核桃每一个都已经夹好了@周嘉人▼家再远爱都在身边从未让你们骄傲你们却始终待我如宝  17 在外很少能吃到手工拽面回家之后妈妈身体不舒服还执意自己磨面粉教我怎么做@Wa玖月▼只有她这样担心你甚至忘了她自己 18 装不下还要硬装想把整个家装进去@NaNa酱strawberry▼你喜欢吃的你爱喝的都像小时候一样给你留着呢 19 我爱吃山上的小樱桃和小草莓姥姥在它们最红的时候天天去给我摘然后一个一个洗干净放冰箱冻上等我放假回来就能吃到@吴百变-▼这是我吃过最好吃而且用钱买不到的宝贝 20 爸妈来找我过节回家之前妈妈准备了很多好吃的冻在冰箱还把菜板贴好了小标签一边切肉,一边切肉@Jessie_JM▼父母在哪里,家就在哪里你在哪里,牵挂就在哪里 21 昨天跟妈说,我今天要回去老妈说让我再待一天,今天给我做锅包肉,给我炖鸡。我就没走!今天晚饭时我说明天回去老妈又说明天给我烙饼吃!让我再待一天!老妈已经各种理由留了我4天了!其实我并不是很想吃,可是我就是舍不得,妈妈以为我是为了吃她做的饭,其实我就是还想陪陪她。@大女人嫌你美世间的爱,唯有父母之爱指向别离。就像龙应台在《目送》里说的:“我慢慢地、慢慢地了解到,所谓父女母子一场,只不过意味着,你和他的缘分就是今生今世不断地目送他的背影渐行渐远。你站在小路的这一端,看着他逐渐消失在小路转弯的地方,而且,他用背影告诉你:不必追。 ”父母的确不必追,子女却要慢点走、多回头。等你拖着重重的行李箱,走到外面的世界,也许必须去做一个坚强独立的大人,应对世界的风霜雨雪。但是打开行李箱,尝一口家乡的味道,心里就像是有了依靠:在远方的家里,永远有人牵挂着你,担心着你,爱着你。总有一顿饭,让你吃得泪流满面。这顿饭里,包含着太多我们无以为报的爱。树欲静而风不止,子欲养而亲不待,不要让父母的等待熬成遗憾,不要让自己的孝心变成后悔。当我们还有时间、还有机会的时候,常回家看看。父母在,人生尚有来处。父母去,人生只剩归途。
3 0 140天前
admin
244
原文转载自:http://mp.weixin.qq.com/s/_-QDjvNv44Esn9O0EChh4A“不忘初心,方得始终。”只有不忘记自己最初的想法,才能有始有终地去完成自己的梦想。“初心”是什么?是孔子“居之不倦,行之以忠”的为政之道;包拯“清心为治本,直道是身谋”的为官箴言;是毛泽东“埋骨何须桑梓地,人生无处不青山”的豪情壮志;是周恩来“为中华之崛起而读书”的宏大理想。不忘初心,方得始终。只有走过弯路,才更确信当初最想要的是什么。真正重要的不是生命里的岁月,而是岁月中的生活。流光容易把人抛,红了樱桃,绿了芭蕉。曾经莫失莫忘,后来梦里花落。纳兰性德说,“人生若只如初见”。在这个时代,初心常常被我们遗忘,“我们已经走得太远,以至于忘记了为什么出发”。因为忘记了初心,我们已经不知道为什么来,要到哪里去。因为忘记了初心,我们走得十分茫然,多了许多柴米油盐的奔波,少了许多仰望星空的浪漫。因为忘记了初心,时光荏苒之后,我们会经常听到人们的忏悔:假如当初我不随意放弃,要是我愿意刻苦,要是我有恒心和毅力,一定不会是眼前的样子。席慕蓉说:我一直相信,生命的本相,不在表层,而是在极深极深的内里。这里的“内里”即为“初心”,它不常显露,很难用语言文字去清楚形容,只能偶尔透过直觉去感知其存在,但在遇到选择之时,在不断地衡量、判断与取舍之时,往往能感知其存在。林清玄说:回到最单纯的初心,在最空的地方安坐,让世界的吵闹去喧嚣它们自己吧!让湖光山色去清秀它们自己吧!让人群从远处走开或者自身边擦过吧!我们只愿心怀清欢,以清净心看世界,以欢喜心过生活,以平常心生情味,以柔软心除挂碍。白岩松说:在墨西哥,有一个离我们很远却又很近的寓言。 一群人急匆匆地赶路,突然,一个人停了下来。旁边的人很奇怪:为什么不走了? 停下的人一笑:走得太快,灵魂落在了后面,我要等等它。我们都走得太快。然而,谁又打算停下来等一等呢?如果走得太远,会不会忘了当初为什么出发?人生只有一次,生命无法重来,要记得自己的初心。经常回头望一下自己的来路,回忆起当初为什么启程。经常纯净自己的内心,给自己一双澄澈的眼睛。不忘初心,才会找对人生的方向,才会坚定我们的追求,抵达自己的初衷。一窗暖阳,一念心安,初心仍在,岁月无恙。闲看花开,静待花落,冷暖自知,干净如始。我希望,今后能以一朵花的姿态行走世间,穿越季节的轮回,在无声中不颓废,不失色,花开成景,花落成诗。回忆中,总有一些瞬间,能温暖整个远去的曾经。世界上唯一的你,就算没有人懂得欣赏,也要好好爱自己。时间很短,天涯很远。今后的一山一水,一朝一夕,安静的去走完。前尘过往终是浮云,最应该珍惜的便是当下。任岁月流逝,你我初心终不改。淡然安逸,心静如水,肆意而恬淡,这才应该是你的生活。-END-
3 0 152天前
admin
324
原文地址:http://weibo.com/ttarticle/p/show?id=2309351002704146441940550858&u=1668632407&m=4146441712461037&cu=1668632407写在前面前两天和几位技术大牛聊天,大家突然发现那些身边的优秀的技术人中,有很多人都拥有相同的路径和很多共同点。简单的说,技术大牛虽然凤毛麟角,但其实成为技术大牛也没有那么困难,就是“有技巧无捷径”。“有技巧”是说,任何一个领域的专家,只要精通该领域的已有知识就可以,只要你的学习能力够强、能够掌握一些经验技巧就一定能够办得到,不像很多岗位对于“创新”的要求,需要用已有的知识创造出未知的产品。“无捷径”是说水到渠成,你把该做的事情一件一件琢磨好,在每一件事情上多下点功夫,自然而然就会有“渠”。除了技术类岗位,很多岗位的要求也都一样,胜任力或者发展轨迹很清晰,看似不难,难得是有人可以沉得下心来细细打磨。就来说说技术大牛们通常不同阶段的注意力都在哪,也可以说是需要你沉下心来好好打磨的四个层次——第一个层次,专业领域内的技术精通。要作为一名技术领域的强人,必须要确保在某个技术方向上非常精通,技术的根基要扎得非常深,稳扎稳打,这是你的技术招牌。前两天朋友圈有人问:“面试时候是否会问设计模式相关的问题。”很多大牛表示很少问道,因为越是优秀的技术人员,注意力越是在一线技术上,越是关注在表面花哨的东西,越写不出牛逼的代码。所以第一个层次,需要沉得下心,深钻技术,细细打磨。第二个层次,有一定的技术广度。技术的深度和广度本来就是一个相辅相成的协同,有时候其实没有办法分出个先后。你会发现,很多技术大牛非常非常的博学,他们似乎都精力无限、兴趣广泛?没错,广度这个事情指的就是信息量,而信息量的获取往往跟精力和兴趣相关。 很多人会询问技术的深度和广度那个更重要,我觉得“吃透一样才是立身之本”,所以广度应该有,但是更多的时候“广度”要辅助“深度”。即时很多事情你并没有做过,但一定要清楚个二三,需要的时候可以立即钻进去。所以第二个层次,需要的是走出去的心境。第三个层次,潜入到行业中了解业务和流程。做得越多,你越会发现没有技术独立存在的场景,技术的存在是为了更好的服务于应用场景,不潜入到一个行业当中,不知晓行业的应用环境、组织流程、商业价值,就难以做出和业务无痕交融的产品。技术是把商业需求转换成产品的一个关键角色,因此第三个层次,需要的是了解技术以外的东西。第四个层次,了解社会心理学。做得更多,你会发现,你会从对技术的研究,变为对行业的研究,再变为对人性的研究。产品最终是为了满足人的需要才有价值,而产品研发本身也需要多人协作。社会心理学主要是研究人际关系。当然了,我觉得这个还是非常难的,一般做到二三层次就已经可以是技术大牛了。对CEO的要求可以这么苛刻。
5 0 179天前
admin
342
比尔·盖茨31岁,就成为世界首富。很多人好奇,作为世界第一大PC系统的创始人,抛弃世界首富的头衔,单单从程序员角度来讨论,比尔盖茨的代码水平如何?其实,比尔·盖茨对写代码有一种狂热的喜好。上高中的时候,为了获得源代码,比尔·盖茨曾经去翻垃圾桶。据了解,在1978年的Microsoft BASIC源代码6502中,比尔·盖茨实现了FOR和GOSUB的所有BASIC语句,函数,运算符,表达式评估,堆栈管理,内存管理器,数组和字符串库。昨日,编程网站w3cschool报道,在未经微软或比尔盖茨同意的情况下,某人公开了1978年的Microsoft BASIC for 6502源代码,以及原始评论、文档和彩蛋,这是目前公开的比尔·盖茨写的最古老程序。除了比尔盖茨外,很多互联网大佬都是程序员出身,比如马化腾、比如雷军等人。TITLE BASIC M6502 8K VER 1.1 BY MICRO-SOFT SEARCH M6502 SALL RADIX 10 ;THROUGHOUT ALL BUT MATH-PAK. $Z:: ;STARTING POINT FOR M6502 SIMULATOR ORG 0 ;START OFF AT LOCATION ZERO. SUBTTL SWITCHES,MACROS. REALIO=4 ;5=STM ;4=APPLE. ;3=COMMODORE. ;2=OSI ;1=MOS TECH,KIM ;0=PDP-10 SIMULATING 6502 INTPRC==1 ;INTEGER ARRAYS. ADDPRC==1 ;FOR ADDITIONAL PRECISION. LNGERR==0 ;LONG ERROR MESSAGES. TIME== 0 ;CAPABILITY TO SET AND READ A CLK. EXTIO== 0 ;EXTERNAL I/O. DISKO== 0 ;SAVE AND LOAD COMMANDS NULCMD==1 ;FOR THE "NULL" COMMAND GETCMD==1 RORSW==1 ROMSW==1 ;TELLS IF THIS IS ON ROM. CLMWID==14 LONGI==1 ;LONG INITIALIZATION SWITCH. STKEND=511 BUFPAG==0 LINLEN==72 ;TERMINAL LINE LENGTH. BUFLEN==72 ;INPUT BUFFER SIZE. ROMLOC= ^O20000 ;ADDRESS OF START OF PURE SEGMENT. KIMROM=1 IFE ROMSW,<KIMROM==0> IFN REALIO-1,<KIMROM==0> IFN ROMSW,< RAMLOC= ^O40000 ;USED ONLY IF ROMSW=1 IFE REALIO,<ROMLOC= ^O20000 ;START AT 8K. RAMLOC=^O1400>> IFE REALIO-3,< DISKO==1 RAMLOC==^O2000 ROMLOC=^O140000 NULCMD==0 GETCMD==1 linlen==40 BUFLEN==81 CQOPEN=^O177700 CQCLOS=^O177703 CQOIN= ^O177706 ;OPEN CHANNEL FOR INPUT CQOOUT=^O177711 ;FILL FOR COMMO. CQCCHN=^O177714 CQINCH=^O177717 ;INCHR'S CALL TO GET A CHARACTER OUTCH= ^O177722 CQLOAD=^O177725 CQSAVE=^O177730 CQVERF=^O177733 CQSYS= ^O177736 ISCNTC=^O177741 CZGETL=^O177744 ;CALL POINT FOR "GET" CQCALL=^O177747 ;CLOSE ALL CHANNELS CQTIMR=^O215 BUFPAG==2 BUF==256BUFPAG STKEND==507 CQSTAT=^O226 CQHTIM=^O164104 EXTIO==1 TIME==1 GETCMD==1 CLMWID==10 PI=255 ;VALUE OF PI CHARACTER FOR COMMODORE. ROMSW==1 RORSW==1 TRMPOS=^O306> IFE REALIO-1,<GETCMD==1 DISKO==1 OUTCH=^O17240 ;1EA0 ROMLOC==^O20000 RORSW==0 CZGETL=^O17132> IFE REALIO-2,< RORSW==0 RAMLOC==^O1000 IFN ROMSW,< RORSW==0 RAMLOC==^O100000> OUTCH==^O177013> IFE REALIO-4,< RORSW==1 NULCMD==0 GETCMD==1 CQINLN==^O176547 CQPRMP==^O63 CQINCH==^O176414 CQCOUT==^O177315 CQCSIN==^O177375 BUFPAG==2 BUF=BUFPAG256 ROMLOC=^O4000 RAMLOC=^O25000 ;PAGE 2A OUTCH=^O176755 CZGETL=^O176414 LINLEN==40 BUFLEN==240 RORSW==1 STKEND=507> IFE RORSW,< DEFINE ROR (WD),< LDAI 0 BCC .+4 LDAI ^O200 LSR WD ORA WD STA WD>> DEFINE ACRLF,< 13 10> DEFINE SYNCHK (Q),< LDAI <Q> JSR SYNCHR> DEFINE DT(Q),< IRPC Q,<IFDIF <Q><">,<EXP "Q">>> DEFINE LDWD (WD),< LDA WD LDY <WD>+1> DEFINE LDWDI (WD),< LDAI <<WD>&^O377> LDYI <<WD>/^O400>> DEFINE LDWX (WD),< LDA WD LDX <WD>+1> DEFINE LDWXI (WD),< LDAI <<WD>&^O377> LDXI <<WD>/^O400>> DEFINE LDXY (WD),< LDX WD LDY <WD>+1> DEFINE LDXYI (WD),< LDXI <<WD>&^O377> LDYI <<WD>/^O400>> DEFINE STWD (WD),< STA WD STY <WD>+1> DEFINE STWX (WD),< STA WD STX <WD>+1> DEFINE STXY (WD),< STX WD STY <WD>+1> DEFINE CLR (WD),< LDAI 0 STA WD> DEFINE COM (WD),< LDA WD EORI ^O377 STA WD> DEFINE PULWD (WD),< PLA STA WD PLA STA <WD>+1> DEFINE PSHWD (WD),< LDA <WD>+1 PHA LDA WD PHA> DEFINE JEQ (WD),< BNE .+5 JMP WD> DEFINE JNE (WD),< BEQ .+5 JMP WD> DEFINE BCCA(Q),< BCC Q> ;BRANCHES THAT ALWAYS BRANCH DEFINE BCSA(Q),< BCS Q> ;THESE ARE USED ON THE 6502 BECAUSE DEFINE BEQA(Q),< BEQ Q> ;THERE IS NO UNCONDITIONAL BRANCH DEFINE BNEA(Q),< BNE Q> DEFINE BMIA(Q),< BMI Q> DEFINE BPLA(Q),< BPL Q> DEFINE BVCA(Q),< BVC Q> DEFINE BVSA(Q),< BVS Q> DEFINE INCW(R),< INC R BNE %Q INC R+1 %Q:> DEFINE SKIP1, <XWD ^O1000,^O044> ;BIT ZERO PAGE TRICK. DEFINE SKIP2, <XWD ^O1000,^O054> ;BIT ABS TRICK. IF1,< IFE REALIO,<PRINTX/SIMULATE/> IFE REALIO-1,<PRINTX KIM> IFE REALIO-2,<PRINTX OSI> IFE REALIO-3,<PRINTX COMMODORE> IFE REALIO-4,<PRINTX APPLE> IFE REALIO-5,<PRINTX STM> IFN ADDPRC,<PRINTX ADDITIONAL PRECISION> IFN INTPRC,<PRINTX INTEGER ARRAYS> IFN LNGERR,<PRINTX LONG ERRORS> IFN DISKO,<PRINTX SAVE AND LOAD> IFE ROMSW,<PRINTX RAM> IFN ROMSW,<PRINTX ROM> IFE RORSW,<PRINTX NO ROR> IFN RORSW,<PRINTX ROR ASSUMED>> PAGE SUBTTL INTRODUCTION AND COMPILATION PARAMETERS. COMMENT --------- ---- -- --------- COPYRIGHT 1976 BY MICROSOFT --------- ---- -- --------- 7/27/78 FIXED BUG WHERE FOR VARIABLE AT BYTE FF MATCHED RETURN SEARCHING FOR GOSUB ENTRY ON STACK IN FNDFOR CALL BY CHANGING STA FORPNT TO STA FORPNT+1. THIS IS A SERIOUS BUG IN ALL VERSIONS. 7/27/78 FIXED BUG AT NEWSTT UNDER IFN BUFPAG WHEN CHECK OF CURLIN WAS DONE BEFORE CURLIN SET UP SO INPUT RETRIES OF FIRST STATEMENT WAS GIVING SYNTAX ERROR INSTEAD OF REDO FROM START (CODE WAS 12/1/77 FIX) 7/1/78 SAVED A FEW BYTES IN INIT FOR COMMODORE (14) 7/1/78 FIXED BUG WHERE REPLACING A LINE OVERFLOWING MEMORY LEFT LINKS IN A BAD STATE. (CODE AT NODEL AND FINI) BUG#4 7/1/78 FIXED BUG WHERE GARBAGE COLLECTION NEVER(!) COLLECTS TEMPS (STY GRBPNT AT FNDVAR, LDA GRBPNT ORA GRBPNT+1 AT GRBPAS) THIS WAS COMMODORE BUG #2 7/1/78 FIXED BUG WHERE DELETE/INSERT OF LINE COULD CAUSE A GARBAGE COLLECTION WITH BAD VARTAB IF OUT OF MEMORY (LDWD MEMSIZ STWD FRETOP=JSR RUNC CLC ALSO AT NODEL) 3/9/78 EDIT TO FIX COMMO TRMPOS AND CHANGE LEFT$ AND RIGHT$ TO ALLOW A SECOND ARGUMENT OF 0 AND RETURN A NULL STRING 2/25/78 FIXED BUG THAT INPFLG WAS SET WRONG WHEN BUFPAG.NE.0 INCREASED NUMLEV FROM 19 TO 23 2/11/78 DISALLOWED SPACES IN RESERVED WORDS. PUT IN SPECIAL CHECK FOR "GO TO" 2/11/78 FIXED BUG WHERE ROUNDING OF THE FAC BEFORE PUSHING COULD CAUSE A STRING POINTER IN THE FAC TO BE INCREMENTED 1/24/78 fixed problem where user defined function undefined check fix was smashing error number in [x] 12/1/77 FIXED PROBLEM WHERE PEEK WAS SMASHING (POKER) CAUSING POKE OF PEEK TO FAIL 12/1/77 FIXED PROBLEM WHERE PROBLEM WITH VARTXT=LINNUM=BUF-2 CAUSING BUF-1 COMMA TO DISAPPEAR 12/1/77 FIXED BUFPAG.NE.0 PROBLEM AT NEWSTT AND STOP : CODE WAS STILL ASSUMING TXTPTR+1.EQ.0 IFF STATEMENT WAS DIRECT NUMLEV==23 ;NUMBER OF STACK LEVELS RESERVED ;BY AN EXPLICIT CALL TO "GETSTK". STRSIZ==3 ;# OF LOCS PER STRING DESCRIPTOR. NUMTMP==3 ;NUMBER OF STRING TEMPORARIES. CONTW==15 ;CHARACTER TO SUPPRESS OUTPUT. PAGE SUBTTL SOME EXPLANATION. COMMENT M6502 BASIC CONFIGURES BASIC AS FOLLOWS LOW LOCATIONS PAGE ZERO STARTUP: INITIALLY A JMP TO INITIALIZATION CODE BUT CHANGED TO A JMP TO "READY". RESTARTING THE MACHINE AT LOC 0 DURING PROGRAM EXECUTION CAN LEAVE THINGS MESSED UP. LOC OF FAC TO INTEGER AND INTEGER TO FAC ROUTINES. "DIRECT" MEMORY: THESE ARE THE MOST COMMONLY USED LOCATIONS. THEY HOLD BOOKKEEPING INFO AND ALL OTHER FREQUENTLY USED INFORMATION. ALL TEMPORARIES, FLAGS, POINTERS, THE BUFFER AREA, THE FLOATING ACCUMULATOR, AND ANYTHING ELSE THAT IS USED TO STORE A CHANGING VALUE SHOULD BE LOCATED IN THIS AREA. CARE MUST BE MADE IN MOVING LOCATIONS IN THIS AREA SINCE THE JUXTAPOSITION OF TWO LOCATIONS IS OFTEN DEPENDED UPON. STILL IN RAM WE HAVE THE BEGINNING OF THE "CHRGET" SUBROUTINE. IT IS HERE SO [TXTPTR] CAN BE THE EXTENDED ADDRESS OF A LOAD INSTRUCTION. THIS SAVES HAVING TO BOTHER ANY REGISTERS. PAGE ONE THE STACK. STORAGE PAGE TWO AND ON IN RAM VERSIONS THESE DATA STRUCTURES COME AT THE END OF BASIC. IN ROM VERSON THEY ARE AT RAMLOC WHICH CAN EITHER BE ABOVE OR BELOW ROMLOC, WHICH IS WHERE BASIC ITSELF RESIDES. A ZERO. [TXTTAB] POINTER TO NEXT LINE'S POINTER. LINE # OF THIS LINE (2 BYTES). CHARACTERS ON THIS LINE. ZERO. POINTER AT NEXT LINE'S POINTER (POINTED TO BY THE ABOVE POINTER). ... REPEATS ... LAST LINE: POINTER AT ZERO POINTER. LINE # OF THIS LINE. CHARACTERS ON THIS LINE. ZERO. DOUBLE ZERO (POINTED TO BY THE ABOVE POINTER). [VARTAB] SIMPLE VARIABLES. 6 BYTES PER VALUE. 2 BYTES GIVE THE NAME, 4 BYTES THE VALUE. ... REPEATS ... [ARYTAB] ARRAY VARIABLES. 2 BYTES NAME, 2 BYTE LENGTH, NUMBER OF DIMENSIONS , EXTENT OF EACH DIMENSION (2BYTES/), VALUES ... REPEATS ... [STREND] FREE SPACE. ... REPEATS ... [FRETOP] STRING SPACE IN USE. ... REPEATS ... [MEMSIZ] HIGHEST MACHINE LOCATION. UNUSED EXCEPT BY THE VAL FUNCTION. ROM -- CONSTANTS AND CODE. FUNCTION DISPATCH ADDRESSES (AT ROMLOC) "FUNDSP" CONTAINS THE ADDRESSES OF THE FUNCTION ROUTINES IN THE ORDER OF THE FUNCTION NAMES IN THE CRUNCH LIST. THE FUNCTIONS THAT TAKE MORE THAN ONE ARGUMENT ARE AT THE END. SEE THE EXPLANATION AT "ISFUN". THE OPERATOR LIST THE "OPTAB" LIST CONTAINS AN OPERATOR'S PRECEDENCE FOLLOWED BY THE ADDRESS OF THE ROUTINE TO PERFORM THE OPERATION. THE INDEX INTO THE OPERATOR LIST IS MADE BY SUBTRACTING OFF THE CRUNCH VALUE OF THE LOWEST NUMBERED OPERATOR. THE ORDER OF OPERATORS IN THE CRUNCH LIST AND IN "OPTAB" IS IDENTICAL. THE PRECEDENCES ARE ARBITRARY EXCEPT FOR THEIR COMPARATIVE SIZES. NOTE THAT THE PRECEDENCE FOR UNARY OPERATORS SUCH AS "NOT" AND NEGATION ARE SETUP SPECIALLY WITHOUT USING THE LIST. THE RESERVED WORD OR CRUNCH LIST WHEN A COMMAND OR PROGRAM LINE IS TYPED IN IT IS STORED IN "BUF". AS SOON AS THE WHOLE LINE HAS BEEN TYPED IN ("INLIN" RETURNS) "CRUNCH" IS CALLED TO CONVERT ALL RESERVED WORDS TO THEIR CRUNCHED VALUES. THIS REDUCES THE SIZE OF THE PROGRAM AND SPEEDS UP EXECUTION BY ALLOWING LIST DISPATCHES TO PERFORM FUNCTIONS, STATEMENTS, AND OPERATIONS. THIS IS BECAUSE ALL THE STATEMENT NAMES ARE STORED CONSECUTIVELY IN THE CRUNCH LIST. WHEN A MATCH IS FOUND BETWEEN A STRING OF CHARACTERS AND A WORD IN THE CRUNCH LIST THE ENTIRE TEXT OF THE MATCHED WORD IS TAKEN OUT OF THE INPUT LINE AND A RESERVED WORD TOKEN IS PUT IN ITS PLACE. A RESERVED WORD TOKEN IS ALWAYS EQUAL TO OCTAL 200 PLUS THE POSITION OF THE MATCHED WORD IN THE CRUNCH LIST. STATEMENT DISPATCH ADDRESSES WHEN A STATEMENT IS TO BE EXECUTED, THE FIRST CHARACTER OF THE STATEMENT IS EXAMINED TO SEE IF IT IS LESS THAN THE RESERVED WORD TOKEN FOR THE LOWEST NUMBERED STATEMENT NAME. IF SO, THE "LET" CODE IS CALLED TO TREAT THE STATEMENT AS AN ASSIGNMENT STATEMENT. OTHERWISE A CHECK IS MADE TO MAKE SURE THE RESERVED WORD NUMBER IS NOT TOO LARGE TO BE A STATEMENT TYPE NUMBER. IF NOT THE ADDRESS TO DISPATCH TO IS FETCHED FROM "STMDSP" (THE STATEMENT DISPATCH LIST) USING THE RESERVED WORD NUMBER FOR THE STATEMENT TO CALCULATE AN INDEX INTO THE LIST. ERROR MESSAGES WHEN AN ERROR CONDITION IS DETECTED, [ACCX] MUST BE SET UP TO INDICATE WHICH ERROR MESSAGE IS APPROPRIATE AND A BRANCH MUST BE MADE TO "ERROR". THE STACK WILL BE RESET AND ALL PROGRAM CONTEXT WILL BE LOST. VARIABLES VALUES AND THE ACTUAL PROGRAM REMAIN INTACT. ONLY THE VALUE OF [ACCX] IS IMPORTANT WHEN THE BRANCH IS MADE TO ERROR. [ACCX] IS USED AS AN INDEX INTO "ERRTAB" WHICH GIVES THE TWO CHARACTER ERROR MESSAGE THAT WILL BE PRINTED ON THE USER'S TERMINAL. TEXTUAL MESSAGES CONSTANT MESSAGES ARE STORED HERE. UNLESS THE CODE TO CHECK IF A STRING MUST BE COPIED IS CHANGED THESE STRINGS MUST BE STORED ABOVE PAGE ZERO, OR ELSE THEY WILL BE COPIED BEFORE THEY ARE PRINTED. FNDFOR MOST SMALL ROUTINES ARE FAIRLY SIMPLE AND ARE DOCUMENTED IN PLACE. "FNDFOR" IS USED FOR FINDING "FOR" ENTRIES ON THE STACK. WHENEVER A "FOR" IS EXECUTED, A 16-BYTE ENTRY IS PUSHED ONTO THE STACK. BEFORE THIS IS DONE, HOWEVER, A CHECK MUST BE MADE TO SEE IF THERE ARE ANY "FOR" ENTRIES ALREADY ON THE STACK FOR THE SAME LOOP VARIABLE. IF SO, THAT "FOR" ENTRY AND ALL OTHER "FOR" ENTRIES THAT WERE MADE AFTER IT ARE ELIMINATED FROM THE STACK. THIS IS SO A PROGRAM THAT JUMPS OUT OF THE MIDDLE OF A "FOR" LOOP AND THEN RESTARTS THE LOOP AGAIN AND AGAIN WON'T USE UP 18 BYTES OF STACK SPACE EVERY TIME. THE "NEXT" CODE ALSO CALLS "FNDFOR" TO SEARCH FOR A "FOR" ENTRY WITH THE LOOP VARIABLE IN THE "NEXT". AT WHATEVER POINT A MATCH IS FOUND THE STACK IS RESET. IF NO MATCH IS FOUND A "NEXT WITHOUT FOR" ERROR OCCURS. GOSUB EXECUTION ALSO PUTS A 5-BYTE ENTRY ON STACK. WHEN A RETURN IS EXECUTED "FNDFOR" IS CALLED WITH A VARIABLE POINTER THAT CAN'T BE MATCHED. WHEN "FNDFOR" HAS RUN THROUGH ALL THE "FOR" ENTRIES ON THE STACK IT RETURNS AND THE RETURN CODE MAKES SURE THE ENTRY THAT WAS STOPPED ON IS A GOSUB ENTRY. THIS ASSURES THAT IF YOU GOSUB TO A SECTION OF CODE IN WHICH A FOR LOOP IS ENTERED BUT NEVER EXITED THE RETURN WILL STILL BE ABLE TO FIND THE MOST RECENT GOSUB ENTRY. THE "RETURN" CODE ELIMINATES THE "GOSUB" ENTRY AND ALL "FOR" ENTRIES MADE AFTER THE GOSUB ENTRY. NON-RUNTIME STUFF THE CODE TO INPUT A LINE, CRUNCH IT, GIVE ERRORS, FIND A SPECIFIC LINE IN THE PROGRAM, PERFORM A "NEW", "CLEAR", AND "LIST" ARE ALL IN THIS AREA. GIVEN THE EXPLANATION OF PROGRAM STORAGE SET FORTH ABOVE, THESE ARE ALL STRAIGHTFORWARD. NEWSTT WHENEVER A STATEMENT FINISHES EXECUTION IT DOES A "RTS" WHICH TAKES EXECUTION BACK TO "NEWSTT". STATEMENTS THAT CREATE OR LOOK AT SEMI-PERMANENT STACK ENTRIES MUST GET RID OF THE RETURN ADDRESS OF "NEWSTT" AND JMP TO "NEWSTT" WHEN DONE. "NEWSTT" ALWAYS CHRGETS THE FIRST CHARACTER AFTER THE STATEMENT NAME BEFORE DISPATCHING. WHEN RETURNING BACK TO "NEWSTT" THE ONLY THING THAT MUST BE SET UP IS THE TEXT POINTER IN "TXTPTR". "NEWSTT" WILL CHECK TO MAKE SURE "TXTPTR" IS POINTING TO A STATEMENT TERMINATOR. IF A STATEMENT SHOULDN'T BE PERFORMED UNLESS IT IS PROPERLY FORMATTED (I.E. "NEW") IT CAN SIMPLY DO A RETURN AFTER READING ALL OF ITS ARGUMENTS. SINCE THE ZERO FLAG BEING OFF INDICATES THERE IS NOT A STATEMENT TERMINATOR "NEWSTT" WILL DO THE JMP TO THE "SYNTAX ERROR" ROUTINE. IF A STATEMENT SHOULD BE STARTED OVER IT CAN DO LDWD OLDTXT, STWD TXTPTR RTS SINCE THE TEXT PNTR AT "NEWSTT" IS ALWAYS STORED IN "OLDTXT". THE ^C CODE STORES [CURLIN] (THE CURRENT LINE NUMBER) IN "OLDLIN" SINCE THE ^C CHECK IS MADE BEFORE THE STATEMENT POINTED TO IS EXECUTED. "STOP" AND "END" STORE THE TEXT POINTER FROM "TXTPTR", WHICH POINTS AT THEIR TERMINATING CHARACTER, IN "OLDTXT". STATEMENT CODE THE INDIVIDUAL STATEMENT CODE COMES NEXT. THE APPROACH USED IN EXECUTING EACH STATEMENT IS DOCUMENTED IN THE STATEMENT CODE ITSELF. FRMEVL, THE FORMULA EVALUATOR GIVEN A TEXT POINTER POINTING TO THE STARTING CHARACTER OF A FORMULA, "FRMEVL" EVALUATES THE FORMULA AND LEAVES THE VALUE IN THE FLOATING ACCUMULATOR (FAC). "TXTPTR" IS RETURNED POINTING TO THE FIRST CHARACTER THAT COULD NOT BE INTERPRETED AS PART OF THE FORMULA. THE ALGORITHM USES THE STACK TO STORE TEMPORARY RESULTS: 0. PUT A DUMMY PRECEDENCE OF ZERO ON THE STACK. 1. READ LEXEME (CONSTANT,FUNCTION, VARIABLE,FORMULA IN PARENS) AND TAKE THE LAST PRECEDENCE VALUE OFF THE STACK. 2. SEE IF THE NEXT CHARACTER IS AN OPERATOR. IF NOT, CHECK PREVIOUS ONE. THIS MAY CAUSE OPERATOR APPLICATION OR AN ACTUAL RETURN FROM "FRMEVL". 3. IF IT IS, SEE WHAT PRECEDENCE IT HAS AND COMPARE IT TO THE PRECEDENCE OF THE LAST OPERATOR ON THE STACK. 4. IF = OR LESS REMEMBER THE OPERATOR POINTER OF THIS OPERATOR AND BRANCH TO "QCHNUM" TO CAUSE APPLICATION OF THE LAST OPERATOR. EVENTUALLY RETURN TO STEP 2 BY RETURNING TO JUST AFTER "DOPREC". 5. IF GREATER PUT THE LAST PRECEDENCE BACK ON, SAVE THE OPERATOR ADDRESS, CURRENT TEMPORARY RESULT, AND PRECEDENCE AND RETURN TO STEP 1. RELATIONAL OPERATORS ARE ALL HANDLED THROUGH A COMMON ROUTINE. SPECIAL CARE IS TAKEN TO DETECT TYPE MISMATCHES SUCH AS 3+"F". EVAL -- THE ROUTINE TO READ A LEXEME "EVAL" CHECKS FOR THE DIFFERENT TYPES OF ENTITIES IT IS SUPPOSED TO DETECT. LEADING PLUSES ARE IGNORED, DIGITS AND "." CAUSE "FIN" (FLOATING INPUT) TO BE CALLED. FUNCTION NAMES CAUSE THE FORMULA INSIDE THE PARENTHESES TO BE EVALUATED AND THE FUNCTION ROUTINE TO BE CALLED. VARIABLE NAMES CAUSE "PTRGET" TO BE CALLED TO GET A POINTER TO THE VALUE, AND THEN THE VALUE IS PUT INTO THE FAC. AN OPEN PARENTHESIS CAUSES "FRMEVL" TO BE CALLED (RECURSIVELY), AND THE ")" TO BE CHECKED FOR. UNARY OPERATORS (NOT AND NEGATION) PUT THEIR PRECEDENCE ON THE STACK AND ENTER FORMULA EVALUATION AT STEP 1, SO THAT EVERYTHING UP TO AN OPERATOR GREATER THAN THEIR PRECEDENCE OR THE END OF THE FORMULA WILL BE EVALUATED. DIMENSION AND VARIABLE SEARCHING SPACE IS ALLOCATED FOR VARIABLES AS THEY ARE ENCOUNTERED. THUS "DIM" STATEMENTS MUST BE EXECUTED TO HAVE EFFECT. 6 BYTES ARE ALLOCATED FOR EACH SIMPLE VARIABLE, WHETHER IT IS A STRING, NUMBER OR USER DEFINED FUNCTION. THE FIRST TWO BYTES GIVE THE NAME OF THE VARIABLE AND THE LAST FOUR GIVE ITS VALUE. [VARTAB] GIVES THE FIRST LOCATION WHERE A SIMPLE VARIABLE NAME IS FOUND AND [ARYTAB] GIVES THE LOCATION TO STOP SEARCHING FOR SIMPLE VARIABLES. A "FOR" ENTRY HAS A TEXT POINTER AND A POINTER TO A VARIABLE VALUE SO NEITHER THE PROGRAM OR THE SIMPLE VARIABLES CAN BE MOVED WHILE THERE ARE ACTIVE "FOR" ENTRIES ON THE STACK. USER DEFINED FUNCTION VALUES ALSO CONTAIN POINTERS INTO SIMPLE VARIABLE SPACE SO NO USER-DEFINED FUNCTION VALUES CAN BE RETAINED IF SIMPLE VARIABLES ARE MOVED. ADDING A SIMPLE VARIABLE IS JUST ADDING SIX TO [ARYTAB] AND [STREND], BLOCK TRANSFERING THE ARRAY VARIABLES UP BY SIX AND MAKING SURE THE NEW [STREND] IS NOT TOO CLOSE TO THE STRINGS. THIS MOVEMENT OF ARRAY VARIABLES MEANS THAT NO POINTER TO AN ARRAY WILL STAY VALID WHEN NEW SIMPLE VARIABLES CAN BE ENCOUNTERED. THIS IS WHY ARRAY VARIABLES ARE NOT ALLOWED FOR "FOR" LOOP VARIABLES. SETTING UP A NEW ARRAY VARIABLE MERELY INVOLVES BUILDING THE DESCRIPTOR, UPDATING [STREND], AND MAKING SURE THERE IS STILL ENOUGH ROOM BETWEEN [STREND] AND STRING SPACE. "PTRGET", THE ROUTINE WHICH RETURNS A POINTER TO A VARIABLE VALUE, HAS TWO IMPORTANT FLAGS. ONE IS "DIMFLG" WHICH INDICATES WHETHER "DIM" CALLED "PTRGET" OR NOT. IF SO, NO PRIOR ENTRY FOR THE VARIABLE IN QUESTION SHOULD BE FOUND, AND THE INDEX INDICATES HOW MUCH SPACE TO SET ASIDE. SIMPLE VARIABLES CAN BE "DIMENSIONED", BUT THE ONLY EFFECT WILL BE TO SET ASIDE SPACE FOR THE VARIABLE IF IT HASN'T BEEN ENCOUNTERED YET. THE OTHER IMPORTANT FLAG IS "SUBFLG" WHICH INDICATES WHETHER A SUBSCRIPTED VARIABLE SHOULD BE ALLOWED IN THE CURRENT CONTEXT. IF [SUBFLG] IS NON-ZERO THE OPEN PARENTHESIS FOR A SUBSCRIPTED VARIABLE WILL NOT BE SCANNED BY "PTRGET", AND "PTRGET" WILL RETURN WITH A TEXT POINTER POINTING TO THE "(", IF THERE WAS ONE. STRINGS IN THE VARIABLE TABLES STRINGS ARE STORED JUST LIKE NUMERIC VARIABLES. SIMPLE STRINGS HAVE THREE VALUE BYTES WHICH ARE INITIALIZED TO ALL ZEROS (WHICH REPRESENTS THE NULL STRING). THE ONLY DIFFERENCE IN HANDLING IS THAT WHEN "PTRGET" SEES A "$" AFTER THE NAME OF A VARIABLE, "PTRGET" SETS [VALTYP] TO NEGATIVE ONE AND TURNS ON THE MSB (MOST-SIGNIFIGANT-BIT) OF THE VALUE OF THE FIRST CHARACTER OF THE VARIABLE NAME. HAVING THIS BIT ON IN THE NAME OF THE VARIABLE ENSURES THAT THE SEARCH ROUTINE WILL NOT MATCH 'A' WITH 'A$' OR 'A$' WITH 'A'. THE MEANING OF THE THREE VALUE BYTES ARE: LOW LENGTH OF THE STRING LOW 8 BITS HIGH 8 BITS OF THE ADDRESS OF THE CHARACTERS IN THE STRING IF LENGTH.NE.0. MEANINGLESS OTHERWISE. HIGH THE VALUE OF A STRING VARIABLE (THESE 3 BYTES) IS CALLED THE STRING DESCRIPTOR TO DISTINGUISH IT FROM THE ACTUAL STRING DATA. WHENEVER A STRING CONSTANT IS ENCOUNTERED IN A FORMULA OR AS PART OF AN INPUT STRING, OR AS PART OF DATA, "STRLIT" IS CALLED, CAUSING A DESCRIPTOR TO BE BUILT FOR THE STRING. WHEN ASSIGNMENT IS MADE TO A STRING POINTING INTO "BUF" THE VALUE IS COPIED INTO STRING SPACE SINCE [BUF] IS ALWAYS CHANGING. STRING FUNCTIONS AND THE ONE STRING OPERATOR "+" ALWAYS RETURN THEIR VALUES IN STRING SPACE. ASSIGNING A STRING A CONSTANT VALUE IN A PROGRAM THROUGH A "READ" OR ASSIGNMENT STATEMENT WILL NOT USE ANY STRING SPACE SINCE THE STRING DESCRIPTOR WILL POINT INTO THE PROGRAM ITSELF. IN GENERAL, COPYING IS DONE WHEN A STRING VALUE IS IN "BUF", OR IT IS IN STRING SPACE AND THERE IS AN ACTIVE POINTER TO IT. THUS F$=G$ WILL CAUSE COPYING IF G$ HAS ITS STRING DATA IN STRING SPACE. F$=CHR$(7) WILL USE ONE BYTE OF STRING SPACE TO STORE THE NEW ONE CHARACTER STRING CREATED BY "CHR$", BUT THE ASSIGNMENT ITSELF WILL CAUSE NO COPYING SINCE THE ONLY POINTER AT THE NEW STRING IS A TEMPORARY DESCRIPTOR CREATED BY "FRMEVL" WHICH WILL GO AWAY AS SOON AS THE ASSIGNMENT IS DONE. IT IS THE NATURE OF GARBAGE COLLECTION THAT DISALLOWS HAVING TWO STRING DESCRIPTORS POINT TO THE SAME AREA IN STRING SPACE. STRING FUNCTIONS AND OPERATORS MUST PROCEED AS FOLLOWS: 1) FIGURE OUT THE LENGTH OF THEIR RESULT. 2) CALL "GETSPA" TO FIND SPACE FOR THEIR RESULT. THE ARGUMENTS TO THE FUNCTION OR OPERATOR MAY CHANGE SINCE GARBAGE COLLECTION MAY BE INVOKED. THE ONLY THING THAT CAN BE SAVED DURING THE CALL TO "GETSPA" IS A POINTER TO THE DESCRIPTORS OF THE ARGUMENTS. 3) CONSTRUCT THE RESULT DESCRIPTOR IN "DSCTMP". "GETSPA" RETURNS THE LOCATION OF THE AVAILABLE SPACE. 4) CREATE THE NEW VALUE BY COPYING PARTS OF THE ARGUMENTS OR WHATEVER. 5) FREE UP THE ARGUMENTS BY CALLING "FRETMP". 6) JUMP TO "PUTNEW" TO GET THE DESCRIPTOR IN "DSCTMP" TRANSFERRED INTO A NEW STRING TEMPORARY. THE REASON FOR STRING TEMPORARIES IS THAT GARBAGE COLLECTION HAS TO KNOW ABOUT ALL ACTIVE STRING DESCRIPTORS SO IT KNOWS WHAT IS AND ISN'T IN USE. STRING TEMPORARIES ARE USED TO STORE THE DESCRIPTORS OF STRING EXPRESSIONS. INSTEAD OF HAVING AN ACTUAL VALUE STORED IN THE FAC, AND HAVING THE VALUE OF A TEMPORARY RESULT BEING SAVED ON THE STACK, AS HAPPENS WITH NUMERIC VARIABLES, STRINGS HAVE THE POINTER TO A STRING DESCRIPTOR STORED IN THE FAC, AND IT IS THIS POINTER THAT GETS SAVED ON THE STACK BY FORMULA EVALUATION. STRING FUNCTIONS CANNOT FREE THEIR ARGUMENTS UP RIGHT AWAY SINCE "GETSPA" MAY FORCE GARBAGE COLLECTION AND THE ARGUMENT STRINGS MAY BE OVER-WRITTEN SINCE GARBAGE COLLECTION WILL NOT BE ABLE TO FIND AN ACTIVE POINTER TO THEM. FUNCTION AND OPERATOR RESULTS ARE BUILT IN "DSCTMP" SINCE STRING TEMPORARIES ARE ALLOCATED (PUTNEW) AND DEALLOCATED (FRETMP) IN A FIFO ORDERING (I.E. A STACK) SO THE NEW TEMPORARY CANNOT BE SET UP UNTIL THE OLD ONE(S) ARE FREED. TRYING TO BUILD A RESULT IN A TEMPORARY AFTER FREEING UP THE ARGUMENT TEMPORARIES COULD RESULT IN ONE OF THE ARGUMENT TEMPORARIES BEING OVERWRITTEN TOO SOON BY THE NEW RESULT. STRING SPACE IS ALLOCATED AT THE VERY TOP OF MEMORY. "MEMSIZ" POINTS BEYOND THE LAST LOCATION OF STRING SPACE. STRINGS ARE STORED IN HIGH LOCATIONS FIRST. WHENEVER STRING SPACE IS ALLOCATED (GETSPA). [FRETOP], WHICH IS INITIALIZED TO [MEMSIZ], IS UPDATED TO GIVE THE HIGHEST LOCATION IN STRING SPACE THAT IS NOT IN USE. THE RESULT IS THAT [FRETOP] GETS SMALLER AND SMALLER, UNTIL SOME ALLOCATION WOULD MAKE [FRETOP] LESS THAN OR EQUAL TO [STREND]. THIS MEANS STRING SPACE HAS RUN INTO THE THE ARRAYS AND THAT GARBAGE COLLECTION MUST BE CALLED. GARBAGE COLLECTION: 0. [MINPTR]=[STREND] [FRETOP]=[MEMSIZ] 1. [REMMIN]=0 2. FOR EACH STRING DESCRIPTOR (TEMPORARIES, SIMPLE STRINGS, STRING ARRAYS) IF THE STRING IS NOT NULL AND ITS POINTER IS .GT.MINPTR AND .LT.FRETOP, [MINPTR]=THIS STRING DESCRIPTOR'S POINTER, [REMMIN]=POINTER AT THIS STRING DESCRIPTOR. END. 3. IF REMMIN.NE.0 (WE FOUND AN UNCOLLECTED STRING), BLOCK TRANSFER THE STRING DATA POINTED TO IN THE STRING DESCRIPTOR POINTED TO BY "REMMIN" SO THAT THE LAST BYTE OF STRING DATA IS AT [FRETOP]. UPDATE [FRETOP] SO THAT IT POINTS TO THE LOCATION JUST BELOW THE ONE THE STRING DATA WAS MOVED INTO. UPDATE THE POINTER IN THE DESCRIPTOR SO IT POINTS TO THE NEW LOCATION OF THE STRING DATA. GO TO STEP 1. AFTER CALLING GARBAGE COLLECTION "GETSPA" AGAIN CHECKS TO SEE IF [ACCA] CHARACTERS ARE AVAILABLE BETWEEN [STREND] AND [FRETOP]; IF NOT, AN "OUT OF STRING" ERROR IS INVOKED. MATH PACKAGE THE MATH PACKAGE CONTAINS FLOATING INPUT (FIN), FLOATING OUTPUT (FOUT), FLOATING COMPARE (FCOMP) ... AND ALL THE NUMERIC OPERATORS AND FUNCTIONS. THE FORMATS, CONVENTIONS AND ENTRY POINTS ARE ALL DESCRIBED IN THE MATH PACKAGE ITSELF. INIT -- THE INITIALIZATION ROUTINE THE AMOUNT OF MEMORY, TERMINAL WIDTH, AND WHICH FUNCTIONS TO BE RETAINED ARE ASCERTAINED FROM THE USER. A ZERO IS PUT DOWN AT THE FIRST LOCATION NOT USED BY THE MATH-PACKAGE AND [TXTTAB] IS SET UP TO POINT AT THE NEXT LOCATION. THIS DETERMINES WHERE PROGRAM STORAGE WILL START. SPECIAL CHECKS ARE MADE TO MAKE SURE ALL QUESTIONS IN "INIT" ARE ANSWERED REASONABLY, SINCE ONCE "INIT" FINISHES, THE LOCATIONS IT USES ARE USED FOR PROGRAM STORAGE. THE LAST THING "INIT" DOES IS CHANGE LOCATION ZERO TO BE A JUMP TO "READY" INSTEAD OF "INIT". ONCE THIS IS DONE THERE IS NO WAY TO RESTART "INIT". HIGH LOCATIONS PAGE SUBTTL PAGE ZERO. IFN REALIO-3,< START: JMP INIT ;INITIALIZE - SETUP CERTAIN LOCATIONS ;AND DELETE FUNCTIONS IF NOT NEEDED, ;AND CHANGE THIS TO "JMP READY" ;IN CASE USER RESTARTS AT LOC ZERO. RDYJSR: JMP INIT ;CHANGED TO "JMP STROUT" BY "INIT" ;TO HANDLE ERRORS. ADRAYI: ADR(AYINT) ;STORE HERE THE ADDR OF THE ;ROUTINE TO TURN THE FAC INTO A ;TWO BYTE SIGNED INTEGER IN [Y,A] ADRGAY: ADR(GIVAYF)> ;STORE HERE THE ADDR OF THE ;ROUTINE TO CONVERT [Y,A] TO A FLOATING ;POINT NUMBER IN THE FAC. IFN ROMSW,< USRPOK: JMP FCERR> ;SET UP ORIG BY INIT. ; ; THIS IS THE "VOLATILE" STORAGE AREA AND NONE OF IT ; CAN BE KEPT IN ROM. ANY CONSTANTS IN THIS AREA CANNOT ; BE KEPT IN A ROM, BUT MUST BE LOADED IN BY THE ; PROGRAM INSTRUCTIONS IN ROM. ; ; --- GENERAL RAM ---: CHARAC: BLOCK 1 ;A DELIMITING CHARACTER. INTEGR= CHARAC ;A ONE-BYTE INTEGER FROM "QINT". ENDCHR: BLOCK 1 ;THE OTHER DELIMITING CHARACTER. COUNT: BLOCK 1 ;A GENERAL COUNTER. ; --- FLAGS ---: DIMFLG: BLOCK 1 ;IN GETTING A POINTER TO A VARIABLE ;IT IS IMPORTANT TO REMEMBER WHETHER IT ;IS BEING DONE FOR "DIM" OR NOT. ;DIMFLG AND VALTYP MUST BE ;CONSECUTIVE LOCATIONS. KIMY= DIMFLG ;PLACE TO PRESERVE Y DURING OUT. VALTYP: BLOCK 1 ;THE TYPE INDICATOR. ;0=NUMERIC 1=STRING. IFN INTPRC,< INTFLG: BLOCK 1> ;TELLS IF INTEGER. DORES: BLOCK 1 ;WHETHER CAN OR CAN'T CRUNCH RES'D WORDS. ;TURNED ON WHEN "DATA" ;BEING SCANNED BY CRUNCH SO UNQUOTED ;STRINGS WON'T BE CRUNCHED. GARBFL= DORES ;WHETHER TO DO GARBAGE COLLECTION. SUBFLG: BLOCK 1 ;FLAG WHETHER SUB'D VARIABLE ALLOWED. ;"FOR" AND USER-DEFINED FUNCTION ;POINTER FETCHING TURN ;THIS ON BEFORE CALLING "PTRGET" ;SO ARRAYS WON'T BE DETECTED. ;"STKINI" AND "PTRGET" CLEAR IT. ;ALSO DISALLOWS INTEGERS THERE. INPFLG: BLOCK 1 ;FLAGS WHETHER WE ARE DOING "INPUT" ;OR "READ". TANSGN: BLOCK 1 ;USED IN DETERMINING SIGN OF TANGENT. IFN REALIO,< CNTWFL: BLOCK 1> ;SUPPRESS OUTPUT FLAG. ;NON-ZERO MEANS SUPPRESS. ;RESET BY "INPUT", READY AND ERRORS. ;COMPLEMENTED BY INPUT OF ^O. IFE REALIO-4,<ORG 80> ;ROOM FOR APPLE PAGE 0 STUFF. ; --- RAM DEALING WITH TERMINAL HANDLING ---: IFN EXTIO,< CHANNL: BLOCK 1> ;HOLDS CHANNEL NUMBER. IFN NULCMD,< NULCNT: 0> ;NUMBER OF NULLS TO PRINT. IFN REALIO-3,< TRMPOS: BLOCK 1> ;POSITION OF TERMINAL CARRIAGE. LINWID: LINLEN ;LENGTH OF LINE (WIDTH). NCMWID: NCMPOS ;POSITION BEYOND WHICH THERE ARE ;NO MORE FIELDS. LINNUM: 0 ;LOCATION TO STORE LINE NUMBER BEFORE BUF ;SO THAT "BLTUC" CAN STORE IT ALL AWAY AT ONCE. 44 ;A COMMA (PRELOAD OR FROM ROM) ;USED BY INPUT STATEMENT SINCE THE ;DATA POINTER ALWAYS STARTS ON A ;COMMA OR TERMINATOR. IFE BUFPAG,< BUF: BLOCK BUFLEN> ;TYPE IN STORED HERE. ;DIRECT STATEMENTS EXECUTE OUT OF ;HERE. REMEMBER "INPUT" SMASHES BUF. ;MUST BE ON PAGE ZERO ;OR ASSIGNMENT OF STRING ;VALUES IN DIRECT STATEMENTS WON'T COPY ;INTO STRING SPACE -- WHICH IT MUST. ;N.B. TWO NONZERO BYTES MUST PRECEDE "BUFLNM". ; --- STORAGE FOR TEMPORARY THINGS ---: TEMPPT: BLOCK 1 ;POINTER AT FIRST FREE TEMP DESCRIPTOR. ;INITIALIZED TO POINT TO TEMPST. LASTPT: BLOCK 2 ;POINTER TO LAST-USED STRING TEMPORARY. TEMPST: BLOCK STRSIZNUMTMP ;STORAGE FOR NUMTMP TEMP DESCRIPTORS. INDEX1: BLOCK 2 ;INDEXES. INDEX= INDEX1 INDEX2: BLOCK 2 RESHO: BLOCK 1 ;RESULT OF MULTIPLIER AND DIVIDER. IFN ADDPRC,< RESMOH: BLOCK 1> ;ONE MORE BYTE. RESMO: BLOCK 1 RESLO: BLOCK 1 ADDEND= RESMO ;TEMPORARY USED BY "UMULT". 0 ;OVERFLOW FOR RES. ; --- POINTERS INTO DYNAMIC DATA STRUCTURES ---; TXTTAB: BLOCK 2 ;POINTER TO BEGINNING OF TEXT. ;DOESN'T CHANGE AFTER BEING ;SETUP BY "INIT". VARTAB: BLOCK 2 ;POINTER TO START OF SIMPLE ;VARIABLE SPACE. ;UPDATED WHENEVER THE SIZE OF THE ;PROGRAM CHANGES, SET TO [TXTTAB] ;BY "SCRATCH" ("NEW"). ARYTAB: BLOCK 2 ;POINTER TO BEGINNING OF ARRAY ;TABLE. ;INCREMENTED BY 6 WHENEVER ;A NEW SIMPLE VARIABLE IS FOUND, AND ;SET TO [VARTAB] BY "CLEARC". STREND: BLOCK 2 ;END OF STORAGE IN USE. ;INCREASED WHENEVER A NEW ARRAY ;OR SIMPLE VARIABLE IS ENCOUNTERED. ;SET TO [VARTAB] BY "CLEARC". FRETOP: BLOCK 2 ;TOP OF STRING FREE SPACE. FRESPC: BLOCK 2 ;POINTER TO NEW STRING. MEMSIZ: BLOCK 2 ;HIGHEST LOCATION IN MEMORY. ; --- LINE NUMBERS AND TEXTUAL POINTERS ---: CURLIN: BLOCK 2 ;CURRENT LINE #. ;SET TO 0,255 FOR DIRECT STATEMENTS. OLDLIN: BLOCK 2 ;OLD LINE NUMBER (SETUP BY ^C,"STOP" ;OR "END" IN A PROGRAM). POKER= LINNUM ;SET UP LOCATION USED BY POKE. ;TEMPORARY FOR INPUT AND READ CODE OLDTXT: BLOCK 2 ;OLD TEXT POINTER. ;POINTS AT STATEMENT TO BE EXEC'D NEXT. DATLIN: BLOCK 2 ;DATA LINE # -- REMEMBER FOR ERRORS. DATPTR: BLOCK 2 ;POINTER TO DATA. INITIALIZED TO POINT ;AT THE ZERO IN FRONT OF [TXTTAB] ;BY "RESTORE" WHICH IS CALLED BY "CLEARC". ;UPDATED BY EXECUTION OF A "READ". INPPTR: BLOCK 2 ;THIS REMEMBERS WHERE INPUT IS COMING FROM. ; --- STUFF USED IN EVALUATIONS ---: VARNAM: BLOCK 2 ;VARIABLE'S NAME IS STORED HERE. VARPNT: BLOCK 2 ;POINTER TO VARIABLE IN MEMORY. FDECPT= VARPNT ;POINTER INTO POWER OF TENS OF "FOUT". FORPNT: BLOCK 2 ;A VARIABLE'S POINTER FOR "FOR" LOOPS ;AND "LET" STATEMENTS. LSTPNT= FORPNT ;PNTR TO LIST STRING. ANDMSK= FORPNT ;THE MASK USED BY WAIT FOR ANDING. EORMSK= FORPNT+1 ;THE MASK FOR EORING IN WAIT. OPPTR: BLOCK 2 ;POINTER TO CURRENT OP'S ENTRY IN "OPTAB". VARTXT= OPPTR ;POINTER INTO LIST OF VARIABLES. OPMASK: BLOCK 1 ;MASK CREATED BY CURRENT OPERATOR. DOMASK=TANSGN ;MASK IN USE BY RELATION OPERATIONS. DEFPNT: BLOCK 2 ;POINTER USED IN FUNCTION DEFINITION. GRBPNT= DEFPNT ;ANOTHER USED IN GARBAGE COLLECTION. DSCPNT: BLOCK 2 ;POINTER TO A STRING DESCRIPTOR. IFN ADDPRC,<BLOCK 1> ;FOR TEMPF3. FOUR6: EXP STRSIZ ;VARIABLE CONSTANT USED BY GARB COLLECT. ; --- ET CETERA ---: JMPER: JMP 60000 SIZE= JMPER+1 OLDOV= JMPER+2 ;THE OLD OVERFLOW. TEMPF3= DEFPNT ;A THIRD FAC TEMPORARY (4 BYTES). TEMPF1: IFN ADDPRC,<0> ;FOR TEMPF1S EXTRA BYTE. HIGHDS: BLOCK 2 ;DESINATION OF HIGHEST ELEMENT IN BLT. HIGHTR: BLOCK 2 ;SOURCE OF HIGHEST ELEMENT TO MOVE. TEMPF2: IFN ADDPRC,<0> ;FOR TEMPF2S EXTRA BYTE. LOWDS: BLOCK 2 ;LOCATION OF LAST BYTE TRANSFERRED INTO. LOWTR: BLOCK 2 ;LAST THING TO MOVE IN BLT. ARYPNT= HIGHDS ;A POINTER USED IN ARRAY BUILDING. GRBTOP= LOWTR ;A POINTER USED IN GARBAGE COLLECTION. DECCNT= LOWDS ;NUMBER OF PLACES BEFORE DECIMAL POINT. TENEXP= LOWDS+1 ;HAS A DPT BEEN INPUT? DPTFLG= LOWTR ;BASE TEN EXPONENT. EXPSGN= LOWTR+1 ;SIGN OF BASE TEN EXPONENT. ; --- THE FLOATING ACCUMULATOR ---: FAC: FACEXP: 0 FACHO: 0 ;MOST SIGNIFICANT BYTE OF MANTISSA. IFN ADDPRC,< FACMOH: 0> ;ONE MORE. FACMO: 0 ;MIDDLE ORDER OF MANTISSA. FACLO: 0 ;LEAST SIG BYTE OF MANTISSA. FACSGN: 0 ;SIGN OF FAC (0 OR -1) WHEN UNPACKED. SGNFLG: 0 ;SIGN OF FAC IS PRESERVED BERE BY "FIN". DEGREE= SGNFLG ;A COUNT USED BY POLYNOMIALS. DSCTMP= FAC ;THIS IS WHERE TEMP DESCS ARE BUILT. INDICE= FACMO ;INDICE IS SET UP HERE BY "QINT". BITS: 0 ;SOMETHING FOR "SHIFTR" TO USE. ; --- THE FLOATING ARGUMENT (UNPACKED) ---: ARGEXP: 0 ARGHO: 0 IFN ADDPRC,<ARGMOH: 0> ARGMO: 0 ARGLO: 0 ARGSGN: 0 ARISGN: 0 ;A SIGN REFLECTING THE RESULT. FACOV: 0 ;OVERFLOW BYTE OF THE FAC. STRNG1= ARISGN ;POINTER TO A STRING OR DESCRIPTOR. FBUFPT: BLOCK 2 ;POINTER INTO FBUFFR USED BY FOUT. BUFPTR= FBUFPT ;POINTER TO BUF USED BY "CRUNCH". STRNG2= FBUFPT ;POINTER TO STRING OR DESC. POLYPT= FBUFPT ;POINTER INTO POLYNOMIAL COEFFICIENTS. CURTOL= FBUFPT ;ABSOLUTE LINEAR INDEX IS FORMED HERE. PAGE SUBTTL RAM CODE. ; THIS CODE GETS CHANGED THROUGHOUT EXECUTION. ; IT IS MADE TO BE FAST THIS WAY. ; ALSO, [X] AND [Y] ARE NOT DISTURBED ; ; "CHRGET" USING [TXTPTR] AS THE CURRENT TEXT PNTR ; FETCHES A NEW CHARACTER INTO ACCA AFTER INCREMENTING [TXTPTR] ; AND SETS CONDITION CODES ACCORDING TO WHAT'S IN ACCA. ; NOT C= NUMERIC ("0" THRU "9") ; Z= ":" OR END-OF-LINE (A NULL) ; ; [ACCA] = NEW CHAR. ; [TXTPTR]=[TXTPTR]+1 ; ; THE FOLLOWING EXISTS IN ROM IF ROM EXISTS AND IS LOADED ; DOWN HERE BY INIT. OTHERWISE IT IS JUST LOADED INTO THIS ; RAM LIKE ALL THE REST OF RAM IS LOADED. ; CHRGET: INC CHRGET+7 ;INCREMENT THE WHOLE TXTPTR. BNE CHRGOT INC CHRGET+8 CHRGOT: LDA 60000 ;A LOAD WITH AN EXT ADDR. TXTPTR= CHRGOT+1 CMPI " " ;SKIP SPACES. BEQ CHRGET QNUM: CMPI ":" ;IS IT A ":"? BCS CHRRTS ;IT IS .GE. ":" SEC SBCI "0" ;ALL CHARS .GT. "9" HAVE RET'D SO SEC SBCI 256-"0" ;SEE IF NUMERIC. ;TURN CARRY ON IF NUMERIC. ;ALSO, SETZ IF NULL. CHRRTS: RTS ;RETURN TO CALLER. RNDX: 128 ;LOADED OR FROM ROM. 79 ;THE INITIAL RANDOM NUMBER. 199 82 IFN ADDPRC,<89> ;ONE MORE BYTE. ORG 255 ;PAGE 1 STUFF COMING UP. LOFBUF: BLOCK 1 ;THE LOW FAC BUFFER. COPYABLE. ;--- PAGE ZERO/ONE BOUNDARY ---. ;MUST HAVE 13 CONTIGUOUS BYTES. FBUFFR: BLOCK 3ADDPRC+13 ;BUFFER FOR "FOUT". ;ON PAGE 1 SO THAT STRING IS NOT COPIED. ;STACK IS LOCATED HERE. IE FROM THE END OF FBUFFR TO STKEND. PAGE SUBTTL DISPATCH TABLES, RESERVED WORDS, AND ERROR TEXTS. ORG ROMLOC STMDSP: ADR(END-1) ADR(FOR-1) ADR(NEXT-1) ADR(DATA-1) IFN EXTIO,< ADR(INPUTN-1)> ADR(INPUT-1) ADR(DIM-1) ADR(READ-1) ADR(LET-1) ADR(GOTO-1) ADR(RUN-1) ADR(IF-1) ADR(RESTORE-1) ADR(GOSUB-1) ADR(RETURN-1) ADR(REM-1) ADR(STOP-1) ADR(ONGOTO-1) IFN NULCMD,< ADR(NULL-1)> ADR(FNWAIT-1) IFN DISKO,< IFE REALIO-3,< ADR(CQLOAD-1) ADR(CQSAVE-1) ADR(CQVERF-1)> IFN REALIO,< IFN REALIO-2,< IFN REALIO-3,< IFN REALIO-5,< ADR(LOAD-1) ADR(SAVE-1)>>>> IFN REALIO-1,< IFN REALIO-3,< IFN REALIO-4,< ADR(511) ;ADDRESS OF LOAD ADR(511)>>>> ;ADDRESS OF SAVE ADR(DEF-1) ADR(POKE-1) IFN EXTIO,< ADR(PRINTN-1)> ADR(PRINT-1) ADR(CONT-1) IFE REALIO,< ADR(DDT-1)> ADR(LIST-1) ADR(CLEAR-1) IFN EXTIO,< ADR(CMD-1) ADR(CQSYS-1) ADR(CQOPEN-1) ADR(CQCLOS-1)> IFN GETCMD,< ADR(GET-1)> ;FILL W/ GET ADDR. ADR(SCRATH-1) FUNDSP: ADR(SGN) ADR(INT) ADR(ABS) IFE ROMSW,< USRLOC: ADR(FCERR)> ;INITIALLY NO USER ROUTINE. IFN ROMSW,< USRLOC: ADR(USRPOK)> ADR(FRE) ADR(POS) ADR(SQR) ADR(RND) ADR(LOG) ADR(EXP) IFN KIMROM,< REPEAT 4,< ADR(FCERR)>> IFE KIMROM,< COSFIX: ADR(COS) SINFIX: ADR(SIN) TANFIX: ADR(TAN) ATNFIX: ADR(ATN)> ADR(PEEK) ADR(LEN) ADR(STR) ADR(VAL) ADR(ASC) ADR(CHR) ADR(LEFT) ADR(RIGHT) ADR(MID) OPTAB: 121 ADR(FADDT-1) 121 ADR(FSUBT-1) 123 ADR(FMULTT-1) 123 ADR(FDIVT-1) 127 ADR(FPWRT-1) 80 ADR(ANDOP-1) 70 ADR(OROP-1) NEGTAB: 125 ADR(NEGOP-1) NOTTAB: 90 ADR(NOTOP-1) PTDORL: 100 ;PRECEDENCE. ADR (DOREL-1) ;OPERATOR ADDRESS. ; ; TOKENS FOR RESERVED WORDS ALWAYS HAVE THE MOST ; SIGNIFICANT BIT ON. ; THE LIST OF RESERVED WORDS: ; Q=128-1 DEFINE DCI(A),<Q=Q+1 DC(A)> RESLST: DCI"END" ENDTK==Q DCI"FOR" FORTK==Q DCI"NEXT" DCI"DATA" DATATK==Q IFN EXTIO,< DCI"INPUT#"> DCI"INPUT" DCI"DIM" DCI"READ" DCI"LET" DCI"GOTO" GOTOTK==Q DCI"RUN" DCI"IF" DCI"RESTORE" DCI"GOSUB" GOSUTK=Q DCI"RETURN" DCI"REM" REMTK=Q DCI"STOP" DCI"ON" IFN NULCMD,< DCI"NULL"> DCI"WAIT" IFN DISKO,< DCI"LOAD" DCI"SAVE" IFE REALIO-3,< DCI"VERIFY">> DCI"DEF" DCI"POKE" IFN EXTIO,< DCI"PRINT#"> DCI"PRINT" PRINTK==Q DCI"CONT" IFE REALIO,< DCI"DDT"> DCI"LIST" IFN REALIO-3,< DCI"CLEAR"> IFE REALIO-3,< DCI"CLR"> IFN EXTIO,< DCI"CMD" DCI"SYS" DCI"OPEN" DCI"CLOSE"> IFN GETCMD,< DCI"GET"> DCI"NEW" SCRATK=Q ; END OF COMMAND LIST. "T" "A" "B" "("+128 Q=Q+1 TABTK=Q DCI"TO" TOTK==Q DCI"FN" FNTK==Q "S" "P" "C" "("+128 ;MACRO DOESNT LIKE ('S IN ARGUMENTS. Q=Q+1 SPCTK==Q DCI"THEN" THENTK=Q DCI"NOT" NOTTK==Q DCI"STEP" STEPTK=Q DCI"+" PLUSTK=Q DCI"-" MINUTK=Q DCI"" DCI"/" DCI"^" DCI"AND" DCI"OR" 190 ;A GREATER THAN SIGN Q=Q+1 GREATK=Q DCI"=" EQULTK=Q 188 Q=Q+1 ;A LESS THAN SIGN LESSTK=Q ; ; NOTE DANGER OF ONE RESERVED WORD BEING A PART ; OF ANOTHER: ; IE . . IF 2 GREATER THAN F OR T=5 THEN... ; WILL NOT WORK!!! SINCE "FOR" WILL BE CRUNCHED!! ; IN ANY CASE MAKE SURE THE SMALLER WORD APPEARS ; SECOND IN THE RESERVED WORD TABLE ("INP" AND "INPUT") ; ANOTHER EXAMPLE: IF T OR Q THEN ... "TO" IS CRUNCHED ; DCI"SGN" ONEFUN=Q DCI"INT" DCI"ABS" DCI"USR" DCI"FRE" DCI"POS" DCI"SQR" DCI"RND" DCI"LOG" DCI"EXP" DCI"COS" DCI"SIN" DCI"TAN" DCI"ATN" DCI"PEEK" DCI"LEN" DCI"STR$" DCI"VAL" DCI"ASC" DCI"CHR$" LASNUM==Q ;NUMBER OF LAST FUNCTION ;THAT TAKES ONE ARG DCI"LEFT$" DCI"RIGHT$" DCI"MID$" DCI"GO" GOTK==Q 0 ;MARKS END OF RESERVED WORD LIST IFE LNGERR,< Q=0-2 DEFINE DCE(X),<Q=Q+2 DC(X)> ERRTAB: DCE"NF" ERRNF==Q ;NEXT WITHOUT FOR. DCE"SN" ERRSN==Q ;SYNTAX DCE"RG" ERRRG==Q ;RETURN WITHOUT GOSUB. DCE"OD" ERROD==Q ;OUT OF DATA. DCE"FC" ERRFC==Q ;ILLEGAL QUANTITY. DCE"OV" ERROV==Q ;OVERFLOW. DCE"OM" ERROM==Q ;OUT OF MEMORY. DCE"US" ERRUS==Q ;UNDEFINED STATEMENT. DCE"BS" ERRBS==Q ;BAD SUBSCRIPT. DCE"DD" ERRDD==Q ;REDIMENSIONED ARRAY. DCE"/0" ERRDV0==Q ;DIVISION BY ZERO. DCE"ID" ERRID==Q ;ILLEGAL DIRECT. DCE"TM" ERRTM==Q ;TYPE MISMATCH. DCE"LS" ERRLS==Q ;STRING TOO LONG. IFN EXTIO,< DCE"FD" ;FILE DATA. ERRBD==Q> DCE"ST" ERRST==Q ;STRING FORMULA TOO COMPLEX. DCE"CN" ERRCN==Q ;CAN'T CONTINUE. DCE"UF" ERRUF==Q> ;UNDEFINED FUNCTION. IFN LNGERR,< Q=0 ; NOTE: THIS ERROR COUNT TECHNIQUE WILL NOT WORK IF THERE ARE MORE ; THAN 256 CHARACTERS OF ERROR MESSAGES ERRTAB: DC"NEXT WITHOUT FOR" ERRNF==Q Q=Q+16 DC"SYNTAX" ERRSN==Q Q=Q+6 DC"RETURN WITHOUT GOSUB" ERRRG==Q Q=Q+20 DC"OUT OF DATA" ERROD==Q Q=Q+11 DC"ILLEGAL QUANTITY" ERRFC==Q Q=Q+16 DC"OVERFLOW" ERROV==Q Q=Q+8 DC"OUT OF MEMORY" ERROM==Q Q=Q+13 DC"UNDEF'D STATEMENT" ERRUS==Q Q=Q+17 DC"BAD SUBSCRIPT" ERRBS==Q Q=Q+13 DC"REDIM'D ARRAY" ERRDD==Q Q=Q+13 DC"DIVISION BY ZERO" ERRDV0==Q Q=Q+16 DC"ILLEGAL DIRECT" ERRID==Q Q=Q+14 DC"TYPE MISMATCH" ERRTM==Q Q=Q+13 DC"STRING TOO LONG" ERRLS==Q Q=Q+15 IFN EXTIO,< DC"FILE DATA" ERRBD==Q Q=Q+9> DC"FORMULA TOO COMPLEX" ERRST==Q Q=Q+19 DC"CAN'T CONTINUE" ERRCN==Q Q=Q+14 DC"UNDEF'D FUNCTION" ERRUF==Q> ; ; NEEDED FOR MESSAGES IN ALL VERSIONS. ; ERR: DT" ERROR" 0 INTXT: DT" IN " 0 REDDY: ACRLF IFE REALIO-3,< DT"READY."> IFN REALIO-3,< DT"OK"> ACRLF 0 BRKTXT: ACRLF DT"BREAK" 0 PAGE SUBTTL GENERAL STORAGE MANAGEMENT ROUTINES. ; ; FIND A "FOR" ENTRY ON THE STACK VIA "VARPNT". ; FORSIZ==2ADDPRC+16 FNDFOR: TSX ;LOAD XREG WITH STK PNTR. REPEAT 4,<INX> ;IGNORE ADR(NEWSTT) AND RTS ADDR. FFLOOP: LDA 257,X ;GET STACK ENTRY. CMPI FORTK ;IS IT A "FOR" TOKEN? BNE FFRTS ;NO, NO "FOR" LOOPS WITH THIS PNTR. LDA FORPNT+1 ;GET HIGH. BNE CMPFOR LDA 258,X ;PNTR IS ZERO, SO ASSUME THIS ONE. STA FORPNT LDA 259,X STA FORPNT+1 CMPFOR: CMP 259,X BNE ADDFRS ;NOT THIS ONE. LDA FORPNT ;GET DOWN. CMP 258,X BEQ FFRTS ;WE GOT IT! WE GOT IT! ADDFRS: TXA CLC ;ADD 16 TO X. ADCI FORSIZ TAX ;RESULT BACK INTO X. BNE FFLOOP FFRTS: RTS ;RETURN TO CALLER. ; ; THIS IS THE BLOCK TRANSFER ROUTINE. ; IT MAKES SPACE BY SHOVING EVERYTHING FORWARD. ; ; ON ENTRY: ; [Y,A]=[HIGHDS] (FOR REASON). ; [HIGHDS]= DESTINATION OF [HIGH ADDRESS]. ; [LOWTR]= LOWEST ADDR TO BE TRANSFERRED. ; [HIGHTR]= HIGHEST ADDR TO BE TRANSFERRED. ; ; A CHECK IS MADE TO ASCERTAIN THAT A REASONABLE ; AMOUNT OF SPACE REMAINS BETWEEN THE BOTTOM ; OF THE STRINGS AND THE HIGHEST LOCATION TRANSFERRED INTO. ; ; ON EXIT: ; [LOWTR] ARE UNCHANGED. ; [HIGHTR]=[LOWTR]-200 OCTAL. ; [HIGHDS]=LOWEST ADDR TRANSFERRED INTO MINUS 200 OCTAL. ; BLTU: JSR REASON ;ASCERTAIN THAT STRING SPACE WON'T ;BE OVERRUN. STWD STREND BLTUC: SEC ;PREPARE TO SUBTRACT. LDA HIGHTR SBC LOWTR ;COMPUTE NUMBER OF THINGS TO MOVE. STA INDEX ;SAVE FOR LATER. TAY LDA HIGHTR+1 SBC LOWTR+1 TAX ;PUT IT IN A COUNTER REGISTER. INX ;SO THAT COUNTER ALGORITHM WORKS. TYA ;SEE IF LOW PART OF COUNT IS ZERO. BEQ DECBLT ;YES, GO START MOVING BLOCKS. LDA HIGHTR ;NO, MUST MODIFY BASE ADDR. SEC SBC INDEX ;BORROW IS OFF SINCE [HIGHTR].GT.[LOWTR]. STA HIGHTR ;SAVE MODIFIED BASE ADDR. BCS BLT1 ;IF NO BORROW, GO SHOVE IT. DEC HIGHTR+1 ;BORROW IMPLIES SUB 1 FROM HIGH ORDER. SEC BLT1: LDA HIGHDS ;MOD BASE OF DEST ADDR. SBC INDEX STA HIGHDS BCS MOREN1 ;NO BORROW. DEC HIGHDS+1 ;DECREMENT HIGH ORDER BYTE. BCC MOREN1 ;ALWAYS SKIP. BLTLP: LDADY HIGHTR ;FETCH BYTE TO MOVE STADY HIGHDS ;MOVE IT IN, MOVE IT OUT. MOREN1: DEY BNE BLTLP LDADY HIGHTR ;MOVE LAST OF THE BLOCK. STADY HIGHDS DECBLT: DEC HIGHTR+1 DEC HIGHDS+1 ;START ON NEW BLOCKS. DEX BNE MOREN1 RTS ;RETURN TO CALLER. ; ; THIS ROUTINE IS USED TO ASCERTAIN THAT A GIVEN ; NUMBER OF LOCS REMAIN AVAILABLE FOR THE STACK. ; THE CALL IS: ; LDAI NUMBER OF 2-BYTE ENTRIES NEEDED. ; JSR GETSTK ; ; THIS ROUTINE MUST BE CALLED BY ANY ROUTINE WHICH PUTS ; AN ARBITRARY AMOUNT OF STUFF ON THE STACK, ; I.E., ANY RECURSIVE ROUTINE LIKE "FRMEVL". ; IT IS ALSO CALLED BY ROUTINES SUCH AS "GOSUB" AND "FOR" ; WHICH MAKE PERMANENT ENTRIES ON THE STACK. ; ; ROUTINES WHICH MERELY USE AND FREE UP THE GUARANTEED ; NUMLEV LOCATIONS NEED NOT CALL THIS. ; ; ; ON EXIT: ; [A] AND [X] HAVE BEEN MODIFIED. ; GETSTK: ASL A, ;MULT [A] BY 2. NB, CLEARS C BIT. ADCI 2NUMLEV+<3ADDPRC>+13 ;MAKE SURE 2NUMLEV+13 LOCS ;(13 BECAUSE OF FBUFFR) BCS OMERR ;WILL REMAIN IN STACK. STA INDEX TSX ;GET STACKED. CPX INDEX ;COMPARE. BCC OMERR ;IF STACK.LE.INDEX1, OM. RTS ; ; [Y,A] IS A CERTAIN ADDRESS. "REASON" MAKES SURE ; IT IS LESS THAN [FRETOP]. ; REASON: CPY FRETOP+1 BCC REARTS BNE TRYMOR ;GO GARB COLLECT. CMP FRETOP BCC REARTS TRYMOR: PHA LDXI 8+ADDPRC ;IF TEMPF2 HAS ZERO IN BETWEEN. TYA REASAV: PHA LDA HIGHDS-1,X ;SAVE HIGHDS ON STACK. DEX BPL REASAV ;PUT 8 OF THEM ON STK. JSR GARBA2 ;GO GARB COLLECT. LDXI 256-8-ADDPRC REASTO: PLA STA HIGHDS+8+ADDPRC,X ;RESTORE AFTER GARB COLLECT. INX BMI REASTO PLA TAY PLA ;RESTORE A AND Y. CPY FRETOP+1 ;COMPARE HIGHS BCC REARTS BNE OMERR ;HIGHER IS BAD. CMP FRETOP ;AND THE LOWS. BCS OMERR REARTS: RTS PAGE SUBTTL ERROR HANDLER, READY, TERMINAL INPUT, COMPACTIFY, NEW, REINIT. OMERR: LDXI ERROM ERROR: IFN REALIO,< LSR CNTWFL> ;FORCE OUTPUT. IFN EXTIO,< LDA CHANNL ;CLOSE NON-TERMINAL CHANNEL. BEQ ERRCRD JSR CQCCHN ;CLOSE IT. LDAI 0 STA CHANNL> ERRCRD: JSR CRDO ;OUTPUT CRLF. JSR OUTQST ;PRINT A QUESTION MARK IFE LNGERR,< LDA ERRTAB,X, ;GET FIRST CHR OF ERR MSG. JSR OUTDO ;OUTPUT IT. LDA ERRTAB+1,X, ;GET SECOND CHR. JSR OUTDO> ;OUTPUT IT. IFN LNGERR,< GETERR: LDA ERRTAB,X PHA ANDI 127 ;GET RID OF HIGH BIT. JSR OUTDO ;OUTPUT IT. INX PLA ;LAST CHAR OF MESSAGE? BPL GETERR> ;NO. GO GET NEXT AND OUTPUT IT. TYPERR: JSR STKINI ;RESET THE STACK AND FLAGS. LDWDI ERR ;GET PNTR TO " ERROR". ERRFIN: JSR STROUT ;OUTPUT IT. LDY CURLIN+1 INY ;WAS NUMBER 64000? BEQ READY ;YES, DON'T TYPE LINE NUMBER. JSR INPRT READY: IFN REALIO,< LSR CNTWFL> ;TURN OUTPUT BACK ON IF SUPRESSED LDWDI REDDY ;SAY "OK". IFN REALIO-3,< JSR RDYJSR> ;OR GO TO INIT IF INIT ERROR. IFE REALIO-3,< JSR STROUT> ;NO INIT ERRORS POSSIBLE. MAIN: JSR INLIN ;GET A LINE FROM TERMINAL. STXY TXTPTR JSR CHRGET TAX ;SET ZERO FLAG BASED ON [A] ;THIS DISTINGUISHES ":" AND 0 BEQ MAIN ;IF BLANK LINE, GET ANOTHER. LDXI 255 ;SET DIRECT LINE NUMBER. STX CURLIN+1 BCC MAIN1 ;IS A LINE NUMBER. NOT DIRECT. JSR CRUNCH ;COMPACTIFY. JMP GONE ;EXECUTE IT. MAIN1: JSR LINGET ;READ LINE NUMBER INTO "LINNUM". JSR CRUNCH STY COUNT ;RETAIN CHARACTER COUNT. JSR FNDLIN BCC NODEL ;NO MATCH, SO DON'T DELETE. LDYI 1 LDADY LOWTR STA INDEX1+1 LDA VARTAB STA INDEX1 LDA LOWTR+1 ;SET TRANSFER TO. STA INDEX2+1 LDA LOWTR DEY SBCDY LOWTR ;COMPUTE NEGATIVE LENGTH. CLC ADC VARTAB ;COMPUTE NEW VARTAB. STA VARTAB STA INDEX2 ;SET LOW OF TRANS TO. LDA VARTAB+1 ADCI 255 STA VARTAB+1 ;COMPUTE HIGH OF VARTAB. SBC LOWTR+1 ;COMPUTE NUMBER OF BLOCKS TO MOVE. TAX SEC LDA LOWTR SBC VARTAB ;COMPUTE OFFSET. TAY BCS QDECT1 ;IF VARTAB.LE.LOWTR, INX ;DECR DUE TO CARRY, AND DEC INDEX2+1 ;DECREMENT STORE SO CARRY WORKS. QDECT1: CLC ADC INDEX1 BCC MLOOP DEC INDEX1+1 CLC ;FOR LATER ADCQ MLOOP: LDADY INDEX1 STADY INDEX2 INY BNE MLOOP ;BLOCK DONE? INC INDEX1+1 INC INDEX2+1 DEX BNE MLOOP ;DO ANOTHER BLOCK. ALWAYS. NODEL: JSR RUNC ;RESET ALL VARIABLE INFO SO GARBAGE ;COLLECTION CAUSED BY REASON WILL WORK JSR LNKPRG ;FIX UP THE LINKS LDA BUF ;SEE IF ANYTHNG THERE BEQ MAIN CLC LDA VARTAB STA HIGHTR ;SETUP HIGHTR. ADC COUNT ;ADD LENGTH OF LINE TO INSERT. STA HIGHDS ;THIS GIVES DEST ADDR. LDY VARTAB+1 STY HIGHTR+1 ;SAME FOR HIGH ORDERS. BCC NODELC INY NODELC: STY HIGHDS+1 JSR BLTU IFN BUFPAG,< LDWD LINNUM ;POSITION THE BINARY LINE NUMBER STWD BUF-2> ;IN FRONT OF BUF LDWD STREND STWD VARTAB LDY COUNT DEY STOLOP: LDA BUF-4,Y STADY LOWTR DEY BPL STOLOP FINI: JSR RUNC ;DO CLEAR & SET UP STACK. ;AND SET [TXTPTR] TO [TXTTAB]-1. JSR LNKPRG ;FIX UP PROGRAM LINKS JMP MAIN LNKPRG: LDWD TXTTAB ;SET [INDEX] TO [TXTTAB]. STWD INDEX CLC ; ; CHEAD GOES THROUGH PROGRAM STORAGE AND FIXES ; UP ALL THE LINKS. THE END OF EACH LINE IS FOUND ; BY SEARCHING FOR THE ZERO AT THE END. ; THE DOUBLE ZERO LINK IS USED TO DETECT THE END OF THE PROGRAM. ; CHEAD: LDYI 1 LDADY INDEX ;ARRIVED AT DOUBLE ZEROES? BEQ LNKRTS LDYI 4 CZLOOP: INY ;THERE IS AT LEAST ONE BYTE. LDADY INDEX BNE CZLOOP ;NO, CONTINUE SEARCHING. INY ;GO ONE BEYOND. TYA ADC INDEX TAX LDYI 0 STADY INDEX LDA INDEX+1 ADCI 0 INY STADY INDEX STX INDEX STA INDEX+1 BCCA CHEAD ;ALWAYS BRANCHES. LNKRTS: RTS ; ; THIS IS THE LINE INPUT ROUTINE. ; IT READS CHARACTERS INTO BUF USING BACKARROW (UNDERSCORE, OR ; SHIFT O) AS THE DELETE CHARACTER AND @ AS THE ; LINE DELETE CHARACTER. IF MORE THAN BUFLEN CHARACTERS ; ARE TYPED, NO ECHOING IS DONE UNTIL A BACKARROW OR @ OR CR ; IS TYPED. CONTROL-G WILL BE TYPED FOR EACH EXTRA CHARACTER. ; THE ROUTINE IS ENTERED AT INLIN. ; IFE REALIO-4,< INLIN: LDXI 128 ;NO PROMPT CHARACTER STX CQPRMP JSR CQINLN ;GET A LINE ONTO PAGE 2 CPXI BUFLEN-1 BCS GDBUFS ;NOT TOO MANY CHARACTERS LDXI BUFLEN-1 GDBUFS: LDAI 0 ;PUT A ZERO AT THE END STA BUF,X TXA BEQ NOCHR LOPBHT: LDA BUF-1,X ANDI 127 STA BUF-1,X DEX BNE LOPBHT NOCHR: LDAI 0 LDXYI <BUF-1> ;POINT AT THE BEGINNING RTS> IFN REALIO-4,< IFN REALIO-3,< LINLIN: IFE REALIO-2,< JSR OUTDO> ;ECHO IT. DEX ;BACKARROW SO BACKUP PNTR AND BPL INLINC ;GET ANOTHER IF COUNT IS POSITIVE. INLINN: IFE REALIO-2,< JSR OUTDO> ;PRINT THE @ OR A SECOND BACKARROW ;IF THERE WERE TOO MANY. JSR CRDO> INLIN: LDXI 0 INLINC: JSR INCHR ;GET A CHARACTER. IFN REALIO-3,< CMPI 7 ;IS IT BOB ALBRECHT RINGING THE BELL ;FOR SCHOOL KIDS? BEQ GOODCH> CMPI 13 ;CARRIAGE RETURN? BEQ FININ1 ;YES, FINISH UP. IFN REALIO-3,< CMPI 32 ;CHECK FOR FUNNY CHARACTERS. BCC INLINC CMPI 125 ;IS IT TILDA OR DELETE? BCS INLINC ;BIG BAD ONES TOO. CMPI "@" ;LINE DELETE? BEQ INLINN ;YES. CMPI "_" ;CHARACTER DELETE? BEQ LINLIN> ;YES. GOODCH: IFN REALIO-3,< CPXI BUFLEN-1 ;LEAVE ROOM FOR NULL. ;COMMO ASSURES US NEVER MORE THAN BUFLEN. BCS OUTBEL> STA BUF,X INX IFE REALIO-2,<SKIP2> IFN REALIO-2,<BNE INLINC> IFN REALIO-3,< OUTBEL: LDAI 7 IFN REALIO,< JSR OUTDO> ;ECHO IT. BNE INLINC> ;CYCLE ALWAYS. FININ1: JMP FININL> ;GO TO FININL FAR, FAR AWAY. INCHR: IFE REALIO-3,< JSR CQINCH> ;FOR COMMODORE. IFE REALIO-2,< INCHRL: LDA ^O176000 REPEAT 4,<NOP> LSR A, BCC INCHRL LDA ^O176001 ;GET THE CHARACTER. REPEAT 4,<NOP> ANDI 127> IFE REALIO-1,< JSR ^O17132> ;1E5A FOR MOS TECH. IFE REALIO-4,< JSR CQINCH ;FD0C FOR APPLE COMPUTER. ANDI 127> IFE REALIO,< TJSR INSIM##> ;GET A CHARACTER FROM SIMULATOR IFN REALIO,< IFN EXTIO,< LDY CHANNL ;CNT-O HAS NO EFFECT IF NOT FROM TERM. BNE INCRTS> CMPI CONTW ;SUPPRESS OUTPUT CHARACTER (^W). BNE INCRTS ;NO, RETURN. PHA COM CNTWFL ;COMPLEMENT ITS STATE. PLA> INCRTS: RTS ;END OF INCHR. ; ; ALL "RESERVED" WORDS ARE TRANSLATED INTO SINGLE ; BYTES WITH THE MSB ON. THIS SAVES SPACE AND TIME ; BY ALLOWING FOR TABLE DISPATCH DURING EXECUTION. ; THEREFORE ALL STATEMENTS APPEAR TOGETHER IN THE ; RESERVED WORD LIST IN THE SAME ORDER THEY ; APPEAR IN STMDSP. ; BUFOFS=0 ;THE AMOUNT TO OFFSET THE LOW BYTE ;OF THE TEXT POINTER TO GET TO BUF ;AFTER TXTPTR HAS BEE
5 0 179天前
admin
282
对自己落井下石的人 新浪微博宋涵 @ 2015-01-13 ★ 8064 人为什么难以获得持久的幸福?除了在欲求不足的痛苦和满足后的无聊间摇摆之外,他们还几乎不懂得珍惜自己,而总是热衷于对自己落井下石——受到伤害以后,许多人最本能的反应不是安慰和爱抚自己,而是和那些伤害自己的势力一起,责备、嘲笑、看轻自己,甚至再一次践踏自己,这就是人心常常做的事。 1 人为什么难以获得持久的幸福?叔本华认为是人的本性使然:“生命是一团欲望,欲望不能满足便痛苦,满足便无聊,人生就在痛苦和无聊之间摇摆。” 这句话的魔力在于,你盯着它看很多遍,还是找不到可供反驳的漏洞。这么普通的牢笼,我们竟然就是逃脱不了。看来只有能克服这种天然本性的人,才能比大多数人获得更长久一点的幸福。 所以,人心是多么矛盾的东西啊,既不顾一切地追求快乐,又不由自主跳到沼泽之中,像一个滑稽的小丑,竭尽全力还是停止不前;而它自己还意识不到,还以为在追寻快乐的大道上一往无前。 然而,阻碍人们获得幸福的本性还不止这一点,如果我们花一点时间,跳出我们习以为常的世界——对,有个好方法是想象自己是外星人,第一次来到地球上,第一次观察到人类(你不妨试一试),就会发现人类行为的另一个奇特之处:他们几乎不懂得珍惜自己,而总是热衷于对自己落井下石,这种狂热甚至到了令一个外星生物心惊肉跳的地步。 对自己落井下石的人Give Yourself a Bear Hug, by Lim Heng Swee. 2 为什么这么说呢?请耐心一点,我会将“外星人”看到的现象一一道来: 降落到地球上的生命,是幸运的,因为这是一个温暖、壮美、丰富、有趣的星球;同时也充满着不幸的可能,因为这个星球上无时不刻在上演淘汰、灾难和毁灭。至于人类社会,就更复杂了,他们有精巧的文明,也有厚重的愚昧和满满的恶意。 一个人从出生到地球上的那一刻起,就身处这样既有好又有坏的环境中。人是如此脆弱,如此容易受到“坏”的伤害。活着的人,总会有些伤害在等待他们:严重的,被人杀害、虐待或羞辱,普通的,被人漠视、嘲弄或误解;看得见的,是淤青流血的肉体,看不见的,是崩溃破碎的灵魂。人不仅要面对大自然的变化无常,还有身边人举着那愚钝粗糙的大锯子、有意或无意切割自己的伤害与痛苦。 任何一个心怀正义和悲悯的人(哪怕是一个“外星人”),看到这样受苦的现象,都会忍不住同情那无辜的受害者,如果有条件,还会给予一点慰藉和一点帮助。 可是,当人自己受到伤害以后,最本能的反应不是安慰和爱抚自己,而是和那些伤害自己的势力一起,责备、嘲笑、看轻自己,甚至再一次践踏自己,这不是太奇怪了吗?可这就是人心常常做的事。 3 不信吗?你去看那些自卑的、佝偻着精神脊椎的人,那些胆怯的、躲避着幸福的人,那些绝望的、放弃任何努力的人,都是源自于他们在毫无反抗力的时候,受到了世界的恶意与伤害。 因为被人不断地说:“你丑得像个怪胎”、“怎么会有你这么笨的小孩”、“为什么要把你生出来”,人就会相信这些话,相信自己是毫无价值的,他/她就再不敢奢望幸福。 因为被人打骂、侮辱、遗弃,人在短暂的愤怒之后,就会怀疑自己活着的意义,“不值得活下去”的念头就会像幽灵一样总是缠着他/她; 哪怕因为最普通的求爱失败、或者错爱了一个人,就怀疑再也不会有人爱自己,于是扔掉仅有的勇气,再不去追寻;或者相信自己只能配得上坏人,心甘情愿地依附着伤害自己的人。——这些都是人心常常做的事啊。 4 这种行为是什么呢?就是在跌落井底之后,人不会拍掉身上的污浊,也不会包扎疼痛的伤口,更不会锻炼力气重回光明之地,而是下意识地搬起石头,狠狠砸自己的腿,让自己再也走不出这样的境地。 人在不知不觉中,也成为了加害者的同盟。 5 伤害发生过后,人对自己的“落井下石”,是如此快速、隐蔽而强大的本能反应,以至于本该有的理解、安慰、鼓励都毫无立足之地。 作为一个外星人,你会看到,人是一个悲哀的物种,因为他们的基因密码里,没有“自爱”的默认设置,他们好像天生就不会自爱。 他们的自爱,都来源于他人的爱,只有被真爱包围时,他们内心的“自爱”才会苏醒和启动。 如果遇到伤害,他们的认知系统,就会自动认同伤害传递的信息,形成顽强的暗示,化为第二次更旷日持久的伤害。 当别人说他/她丑,他/她就要用尽一切办法证明自己不丑;当父母忽视他/她,他/她就要拼命成为一个耀眼的人,要被父母看见和重视;当整个世界都曾苛刻地对待过他/她,他/她就会用玩世不恭的桀骜态度来表达无法爱上任何一个人的绝望。在这一切的“努力”深处,藏着惶恐和恐惧,正是他们在认同那些声音:“你就是丑”、“你就是个失败者”、“你就是没人爱”。给自己一个温柔的拥抱,肯定自己的存在,竟是这么难。 对自己落井下石的人 6 外星人会感叹,这是一个多么悲哀的循环:“自爱”要有“他爱”才能启动,可是,没有“自爱”的人又无法给予“他爱”,那么他/她身边的人,也无法启动“自爱”。 等等,外星人不要急着离开。我们再重新审问一下这个论断:人的基因密码里,真的没有“自爱”的默认设置吗? 如果没有,那么最初的、来自他人的“爱”是怎么来的?真的是来自“上帝”吗?假若真的是“上帝”的爱启动了人类的爱,那么每一个个体的内心中不正是有了“自爱”的种子? 看来之前的结论是太武断了。聪明的外星人得修正一下,“自爱”只是习惯沉睡而已,在许多人的一生中很少发挥作用,但也有罕见的案例:无论受到怎样的伤害,这些人永远是自己的支持者;他们绝不对自己落井下石。 曾经有大学生被拍到全裸洗澡的照片,受不了舆论的压力而跳楼自杀;但是,也有一个叫珍妮弗·劳伦斯的女人,在卷入“艳照门”事件后,选择为自己撑腰,对着全世界的恶意大声说:“我不知道我有什么好道歉的。”从外星人的角度看,珍妮弗·劳伦斯的做法明显更合理;为了他人的恶意而惩罚自己,不是不可理喻吗?但从人类的历史来看,珍妮弗·劳伦斯反而是个奇葩。 对自己落井下石的人 还有一个叫奥普拉·温弗瑞的女人,从小就被虐待和性侵,14岁就生下了第一个孩子,可是她没有像大多数人那样,被伤害所毁灭,她只需要简单地告诉自己一件事:“这些都不是我的错”,就能一步一步接近她想要的正常生活。 如果你仔细辨认,你一定能在茫茫人海中认出这些人。 这些人被称为“坚强”或“英雄”,可是他们只是懂得温柔地爱自己而已。他们就是坚定一个信念:即使全世界都不爱你(事实上,全世界都不爱你,这只是某一种绝望境地中的狭隘错觉),你总有一个坚定的拥护者:你自己。 神奇的事情是,当一个人在无论如何的情况下,都能突破恐惧与绝望,去珍惜自己时,残酷的世界也会呈现出温柔的一面。 7 “不爱自己”是人类的死穴,虽然一部分人整天嚷着要“爱别人”,还有一部分有觉醒的人呼吁要“爱自己”,然而真正做到能爱自己的,非常罕见。我们总是不自觉地,在伤害我们的外在势力上,补上最关键的一刀。 爱自己,是知行合一,这个难度级别估计仅次于克服叔本华的“钟摆定律”。 无论如何,活着就是要活得更智慧和更幸福。我们无法完全克服本能,但我们可以在本能冲动之前,留一点迟疑和观察。世界辽阔无常,有些路总要一个人走,在这条路上,我们可以尽量去做:少一点对自己“落井下石”,多给自己一点理解的拥抱。■
5 0 215天前
快速发帖 高级模式
桂公网安备 45010302000666号 桂ICP备14001770-3号
您的IP:54.160.153.233,2018-02-26 09:10:03,Processed in 1.20312 second(s).
免责声明: 本网不承担任何由内容提供商提供的信息所引起的争议和法律责任。
Powered by HadSky 5.4.1